for a given module, you need to add a special function specific to your code. For instance, you have added a little Ajax part to your template, and you want to add on Ajax function on the server side. You can add it directly in "modules/[modname]/pnajax.php" . BUT it's not easily "maintainable", you will have to edit the pnajax file each time there is an update of the module
Solution:
Zikula implements a really interesting systeme, which allow you to add (or override) function to your module without touching it. Indeed, you store your functions in a separate file , and zikula will automatically look in this file to execute the given function.
How to
It simple if you ve got a "[modname]_[type]_[func]", create a file with the following syntaxe
Code
config/functions/<modname>/pn<type>/<func>.php
And then copy your function in it
For instance, if you've got a News_ajax_edit() function, go to
Code
config/functions/News/pnajax/edit.php
and put your function in it.
then when you will upgrade your module your function won't be affected (this has to be used with template overriding :) )
Thanks to Mateo and Guite for their help
http://code.zikula.org/core/ticket/651
Notes:i m not sure it's possible to override function if you ve got modules/modname/pnuser.php, which could be interesting for function like "encode()" or "decodeurl()" for rewriting urls
Notes bis: if you can put your function in "themes/[mytheme]/functions/[modname]/[type]/[func].php" too
edited by: mumuri, Dec 10, 2008 - 03:51 AM
