>I don't want to render it yet, I just want to know whether I should add
>the partial or the action to my $return_value.
>
$front = Zend_Controller_Front::getInstance();
$dispatcher = $front->getDispatcher();
$test = new Zend_Controller_Request_Http()
$test->setParams(array(
'action' => 'foo',
'controller' => 'bar',
'module' => 'baz'
)
);
if($dispatcher->isDispatchable($test) {
// action method exists
} else {
// no action method, use partial
}
--
"Experience is the name everyone gives to their mistakes."
☘ Oscar Wilde
没有评论:
发表评论