-
Notifications
You must be signed in to change notification settings - Fork 0
Developing Plugins
Joe edited this page May 28, 2017
·
1 revision
The point of plugins is to allow injection of PHP code at any hooked point very easily. Not very discoverable, but the functionality seems sound.
In admin, you can assign a hook like
-
hook_name:post app blog view -
plugin:disqus -
config:littlefoot
In the above example, we use the DISQUS plugin: https://github.com/lfcms/Disqus/blob/master/index.php#L6
It simply resolves $config in the plugin index and print to screen after the app Blog's /view method call. This would be where a given post would be displayed, so now all posts have DISQUS comments!
- The actual hook that runs for this example is triggered in the CMS content render step as linked above.
- The linked code loops through the method chain in the URL as such:
Given http://domain.com/littlefoot/blog/view/14,
->run('post app '.$className.' '.implode(' ', $varstr));
post app blog view 14post app blog viewpost app blog
And if you have a plugin hooked to any of those, it will render at that point. Very granular.