php - How to run a controller from a helper. Zend Framework 1.12 -


i understand isn't true way! tell me, how can run other module->controller action helper? or give me other way!

i have api module, , need run api module helper prepared request params. have thoughts this?

into action_helper try apply code:

require_once "../../modules/somemodule/controllers/somecontroller.php"; $ctrl = new somemodule_somecontroller($request, $response); $ctrl->run(); 

but error:

fatal error:  require_once(): failed opening required '../../modules/somemodule/controllers/somecontroller.php' (include_path='..') in /path/to/helper/action 

solution

if ask question on another

how run controller controller?

we've got answer =)
action helper

$that = $this->getactioncontroller(); $that->forward("someaction", "somecontroller", "somemodule", $params); 

if ask question on another

how run controller controller?

we've got answer =)
action helper

$that = $this->getactioncontroller(); $that->forward("someaction", "somecontroller", "somemodule", $params); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

ios - Possible to get UIButton sizeThatFits to work? -