php - Controller/JToolBar not working in Joomla 2.5 -


relevant code:

jtoolbarhelper::custom('savecategories', 'save', '', 'save', false, false); ... <input type="hidden" name="controller" value="easyblogcontroller"> 

according can dig docs , own previous questions, should call savecategories() function in easyblogcontroller. i've tried setting value easyblog, easyblog.php (file name) current easyblogcontroller (class name).

clicking on save button refreshes page. not redirect, echo or var_dump test code put in savecategories() function. var_dumping jrequest::getvar('controller') , 'task' return correct values. creating controller object , using $controller->execute('task'); works.

the values going depend on location of controller trying call, , have couple options here. typically there controller in base folder of component (likely components/com_easyblog) in file called controller.php , class name inside of easyblogcontroller.

there may controllers folder (components/com_easyblog/controllers) contain controllers particular views. typically in case, have file called "something.php" , class "easyblogcontrollersomething". option, call controller's savecategories function using following:

jtoolbarhelper::custom('something.savecategories', 'save', '', 'save', false, false); 

otherwise, if want base controller, don't specify controller, since system default controller.php file. such following:

jtoolbarhelper::custom('savecategories', 'save', '', 'save', false, false); //no hidden input after 

if want set controller other default, add html view:

<input type="hidden" name="controller" value="controllernamehere"/> 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -