When developing a plugin, I am registering routes to controller actions. Other frameworks, read that as Laravel, typically return the controllers response.
public function showProfile($id)
{
$user = User::find($id);
return View::make('user.profile', array('user' => $user));
}
However, in Craft to render a template from your controller you would use the following.
public function actionPluginIndex()
{
$this->renderTemplate('pluginName/template');
}
At the same time, you can also return the rendered template this way and it functions as expected.
public function actionPluginIndex()
{
return $this->renderTemplate('pluginName/template);
}
Looking at craft/app/controllers/BaseController.php
templateRender method shows that it accepts a parameter return
.
So the real question is to return or not to return
and I was hoping for a more technical explanation on the way Craft handles this.