Skip to content

Commit

Permalink
fixed My Module / fixed default view names in dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ScaraX committed Jun 23, 2011
1 parent 24e16f1 commit ba99f6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/MiniMVC/MiniMVC/Dispatcher.php
Expand Up @@ -446,7 +446,7 @@ public function call($controller, $action, $params)
}

$viewName = $this->registry->settings->get('config/classes/view', 'MiniMVC_View');
$view = new $viewName($controllerParts[0], strtolower($controllerParts[1].'/'.$action));
$view = new $viewName($controllerParts[0], strtolower($controllerParts[1]).'/'.$action);

$controllerClass = new $controllerName($view);
$this->registry->events->notify(new sfEvent($controllerClass, 'minimvc.call', array('controller' => $controller, 'action' => $action, 'params' => $params)));
Expand Down
8 changes: 4 additions & 4 deletions module/My/controller/Default.php
Expand Up @@ -5,10 +5,10 @@ class My_Default_Controller extends MiniMVC_Controller
public function indexAction($params)
{
$this->view->setFile('static/home');
if ($title = $this->view->t->get('homeTtitle')) {
if ('homeTitle' !== ($title = $this->view->t->get('homeTtitle'))) {
$this->registry->helper->meta->setTitle($title);
}
if ($description = $this->view->t->get('homeDescription')) {
if ('homeDescription' !==($description = $this->view->t->get('homeDescription'))) {
$this->registry->helper->meta->setDescription($description);
}
}
Expand All @@ -30,10 +30,10 @@ public function staticAction($params)
if (!empty($params['page'])) {
$page = $params['page'];
$this->view->setFile('static/'.$page);
if ($title = $this->view->t->get($page.'Title')) {
if ($page.'Title' !== ($title = $this->view->t->get($page.'Title'))) {
$this->registry->helper->meta->setTitle($title);
}
if ($description = $this->view->t->get($page.'Description')) {
if ($page.'Description' !== ($description = $this->view->t->get($page.'Description'))) {
$this->registry->helper->meta->setDescription($description);
}
}
Expand Down

0 comments on commit ba99f6f

Please sign in to comment.