Jump to content

MVC auto render view question.


ballhogjoni

Recommended Posts

So change it to something you prefer. Like rather than call show() you can set a view name using a default of "(action)View.php". The Router then calls a method on BaseController to show the view, and that method basically does

$this->registry->template->show($this->viewName);

I would structure it like

// router
controller = new controller;
controller->execute(action);

// BaseController::execute
this->viewName = action + "View.php";
this->action();
this->registry->template->show(this->viewName);

// controller::action
this->viewName = "customView.php";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.