houssemamri / core-module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Core Web App - Core Module

Installation

composer require gerizal/core-module dev-master

Hooks

To use action and filter hooks, please follow these steps:

Open config/app.php file and add this to the providers array:

Modules\Core\Providers\CwaHookServiceProvider::class,

Next, add this to the aliases array:

'CwaHooks' => Modules\Core\Facades\CwaHooks::class,

If you open the Providers/CwaHookServiceProvider.php, there are action and filter hook for testing. To use those hooks, you can try something like this:

\CwaHooks::action('cwa.test.action.hook', 'awesome');
\CwaHooks::filter('cwa.test.filter.hook', 'awesome');

To test the hooks via blade template, you can try something like this:

@action('cwa.test.action.hook', 'awesome')
@filter('cwa.test.filter.hook', 'awesome')

Hooks Development

Right now, the action and filter hooks are just for testing. For future development, if there is some hooks that needs to be implemented in Core Web App, the main file to add hooks (both action and filter) will be in Providers/CwaHookServiceProvider.php.

About


Languages

Language:JavaScript 45.0%Language:HTML 33.6%Language:CSS 10.3%Language:PHP 4.5%Language:Blade 4.4%Language:Less 1.9%Language:Go 0.2%Language:Python 0.1%Language:SCSS 0.0%