Recommend this page to a friend! |
Classes of Nahid Bin Azhar | hookr | readme.md | Download |
|
DownloadPHP hookrA PHP package for action and filter hook. Its helps to you fire any event with your desire action. Its a similar service as WP action and filter. InstallationWrite these command from you terminal.
Laravel ConfigurationAfter complete installation go to
and add this line in aliases section
Thats all UsagesIts so easy to use. Just follow the instruction and apply with your laravel project. ActionYou want to extra control with your application without touching your code you apply Action. Suppose you have a blog editor panel. Where you want add extra buttons from others developer without rewrite your code. so lets see.
See, here we use
After run this code add new button will add with existing button.
You can also bind multiple action with this hook. Hookr also support filter. Remind this when you bind multiple filter in a hook then every filter get data from previous filters return data. Suppose you want to add a filter hook in a blog view section.
So we register a filter as 'posts'. Now another developer wants to support markdown for blog posts. so he can bind a filter for parse markdown.
Note: In filter, every callback function must have at least one param which is represent current data so if you want to bind multiple data then
Now then given data is parse by markdown and bbcode. See, here is second param for |