Welcome Guest, Not a member yet? Register   Sign In
extend a custom controller
#1

[eluser]davidino86[/eluser]
hi,
i want to extends a custom controller to another controller, for example:

there is a controller named panel.php that extends the CI Controller class

after i had another controller named annunci.php and i want to extended it at the class of the controller panel.php.

is it possible? and How?

thank you in advance.
#2

[eluser]flaky[/eluser]
example
Code:
class Annunci extends Panel{
    public function Annunci(){
        parent::Panel():
    }
}
#3

[eluser]davidino86[/eluser]
i try your example but i recive this error message:

"Fatal error: Class 'Panel' not found in F:\www_SitiWeb\portobello\system\application\controllers\annunci.php on line 16"

i have the panel.php controller in a subdirectory into controllers main directory named backoffice. i don't know if it is the cause of the error message above.
#4

[eluser]flaky[/eluser]
Code:
require_once(BASEPATH . 'application/controllers/backoffice/panel' . EXT);
class Annunci extends Panel{
    public function Annunci(){
        parent::Panel():
    }
}
#5

[eluser]davidino86[/eluser]
mmm i think it's the correct way but now i have this error message:

Code:
Message: require_once(F:\www_SitiWeb\portobello/system/application/controllers/backoffice/panel.php) [function.require-once]: failed to open stream: No such file or directory

maybe f: is not allowed directory....i don't know




Theme © iAndrew 2016 - Forum software by © MyBB