Ver Mensaje Individual
  #6 (permalink)  
Antiguo 29/09/2009, 08:49
tucuguara
 
Fecha de Ingreso: septiembre-2009
Mensajes: 27
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: Zend Framework + Layouts: Se pueden usar Controllers?

Hola que tal!!

Estuve intantando hacer que el layout reaccione con un controlador pero eso ejemplo de MyPlugin ese php donde lo guardo?? en los layout/scripts?? o en controladores??. y siguiendo con lo de frontcontroller donde se registra???

quiero saber porque estoy intentando hacer el ejemplo que esta en la pagina oficial:
layout.phtml

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Site</title>
</head>
<body>

<?php
// fetch 'content' key using layout helper:
echo $this -> layout ()-> content ;

// fetch 'foo' key using placeholder helper:
echo $this -> placeholder ( 'Zend_Layout' )-> foo ;

// fetch layout object and retrieve various keys from it:
$layout = $this -> layout ();
echo $layout -> bar ;
echo $layout -> baz ;
echo $this->layout()->title;
?>
</body>
</html>


y el fooController.php es:
<?php
class FooController extends Zend_Controller_Action
{
public function fooAction()
{
$this->view->title = 'Validaci&oacute;n';
}
public function barAction()
{
$this->view->title = 'Validaci&oacute;n';
// disable layouts for this action:
$this->_helper->layout->disableLayout();
}

public function bazAction()
{
$this->view->title = 'Validaci&oacute;n';
// use different layout script with this action:
$this->_helper->layout->setLayout('foobaz');
}
}

Pero no me hace nada, solamente me muestra el contenido... como hago???