FLEXIcontent frontend controller supports calling functions inside a flexicontent plugins as TASKs ... !!
This way you can extend flexicontent controller without hacking it
NOTE: these functions can of course be called via AJAX too
1. Place your functions inside the joomla plugin (flexicontent field)
e.g. see the code of our "file" field (joomla plugin):
class plgFlexicontent_fieldsFile extends JPlugin { static $field_types = array('file'); var $task_callable = array('share_file_form', 'share_file_email');
Notice the PHP array:
var $task_callable = array('share_file_form', 'share_file_email');
[b]which states which functions are allowed to be called directly[/b]
2. then of course add the needed functions to the plugin in our example:
function share_file_form() { ... } function share_file_email() { ... }
3. then call them with URLs like:
index.php? option=com_flexicontent &tmpl=component &task=call_extfunc &exttype=plugins &extfolder=flexicontent_fields &extname=file &extfunc=share_file_form &var1=val1 &var2=val2 &var3=val3