Hello all,
I was wondering if there is any voodoo magic involved in getting access to the assign() function in $serendipity['smarty'] from a plugin. I've never used smarty templates before, and am trying to adjust the mood pluging to use them, but have run into some problems. $serendipity['smarty']->assign() complains that it's a call to a member function on a non-object. I have global'd $serendipity...
Thanks,
Brett
smarty->assign()
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: smarty->assign()
Hi!
Yes, accessing the $serendipty['smarty'] is possible. But it depends on the plugin hook you're using. In the frontend_configure hook it's not yet available, but i.e. the "display_entries" header has it available.
Also make sure you're using "global $serendipity" inside your plugin function...
Regards,
Garvin
Yes, accessing the $serendipty['smarty'] is possible. But it depends on the plugin hook you're using. In the frontend_configure hook it's not yet available, but i.e. the "display_entries" header has it available.
Also make sure you're using "global $serendipity" inside your plugin function...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
kidgoo wrote:I have global'd $serendipity...
Yes, I havegarvinhicking wrote:Also make sure you're using "global $serendipity" inside your plugin function...
This explains a lot, though. Is it available in any of the backend hooks?
Btw, is this documented anywhere? The list of hooks on the main site seems to be out-dated...
Thanks,
Brett
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
No, the backend hooks usually do not call and use Smarty Templating, so the object is not needed/used there.
Sadly yes the list of hooks is outdated, we could use some documenting help there. Finding them is easy by searching for "serendipity_plugin_api::hook_event" in the sourcecode files
Regards,
Garvin
Sadly yes the list of hooks is outdated, we could use some documenting help there. Finding them is easy by searching for "serendipity_plugin_api::hook_event" in the sourcecode files
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/