I'm trying to create a profile page with some profile info, picture and tabs. I need tabs to work with and without ajax.
This is what I came up with. The ajax part will come later I just want to ask is this correct in terms of mvc?
Is there a better way you can show me?
Code: Select all
class ProfileController extends Zend_Controller_Action
{
public function showAction()
{
// Get params from request
$params = $this->_request->getParams();
(...)
// Get content
if (method_exists($this, $params['mode'].'Action'))
{
$this->view->tab_content= call_user_func_array(array($this, $params['mode'].'Action'), null);
}
else
{
$this->view->tab_content= call_user_func_array(array($this, 'aboutAction'), null);
}
}
// Tabs
public function aboutAction()
{
(...)
return $this->view->render("profile/about.phtml");
}
public function worksAction()
{
(...)
return $this->view->render("profile/works.phtml");
}
(...)