php - Error:Declaration of ProfileControllerSetting::cancel() should be compatible with JControllerForm::cancel($key = NULL) -
hey new in joomla , making component called profile. getting error in folder controllers/setting.php. here's code;
class profilecontrollersetting extends jcontrollerform {
function save(){ parent::save(); if($this->task=='save') $this->setredirect('index.php?option=com_profile'); } function cancel(){ $this->setredirect('index.php?option=com_profile'); } }
the error coming is:strict standards: declaration of profilecontrollersetting::cancel() should compatible jcontrollerform::cancel($key = null)
and
strict standards: declaration of profilecontrollersetting::save() should compatible jcontrollerform::save($key = null, $urlvar = null)
please me .
how interpreter telling already, yo have parameterise functions. try like:
class profilecontrollersetting extends jcontrollerform { public function save($key = null){ parent::save(); if($this->task=='save') $this->setredirect('index.php?option=com_profile'); } public function cancel($key = null, $urlvar = null){ $this->setredirect('index.php?option=com_profile'); } }
since cannot overload php-functions extending class jcontrollerform
. have follow definition of function load , save declared in jcontrollerform
.
Comments
Post a Comment