Yo creé un virtual Host (que era lo que me recomendaban) y lo direccioné a mi carpeta public, inclusive cuando voy a mi navegador y escribo http://project.zend/ (alias de mi virtual host) este me lleva al layout.phtml (que es lo normal) y me muestra lo que ahí tiene, hasta ahí normal, pero cuando quiero ver una de mis vistas, y pongo en el navegador el módulo, nombre de mi controlador seguido del la función Action, de esta forma: http://project.zend/admin/Guestbook/index, no me muestra nada, les muestro la configuración que realicé:
Aplication.ini:
Cita:
index.php:[production]
;First resource to load
resources.modules[] =
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
autoloaderNamespaces[] = "My"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/modules/admin/controllers"
resources.layout.layoutPath = APPLICATION_PATH "/modules/admin/layouts/scripts"
resources.layout.layout = layout
resources.view[] =
resources.view.basePath = APPLICATION_PATH "/modules/admin/views/"
;Modules config
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
admin.resources.layout.layoutPath = APPLICATION_PATH "/modules/admin/layouts/scripts"
admin.resources.layout.layout = layout
;First resource to load
resources.modules[] =
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
autoloaderNamespaces[] = "My"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/modules/admin/controllers"
resources.layout.layoutPath = APPLICATION_PATH "/modules/admin/layouts/scripts"
resources.layout.layout = layout
resources.view[] =
resources.view.basePath = APPLICATION_PATH "/modules/admin/views/"
;Modules config
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
admin.resources.layout.layoutPath = APPLICATION_PATH "/modules/admin/layouts/scripts"
admin.resources.layout.layout = layout
Código PHP:
<?php
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
require_once 'Zend/Application.php';
$application = new Zend_Application(APPLICATION_ENV,APPLICATION_PATH . '/configs/application.ini');
$application->bootstrap()->run();
Código PHP:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initDoctype()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->doctype('XHTML1_STRICT');
}
protected function _initView()
{
$view = new Zend_View();
$view->doctype('XHTML1_STRICT');
$view->headTitle('My First Zend Framework Application');
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelp er('ViewRenderer');
$viewRenderer->setView($view);
return $view;
}
protected function _initPlugins(){
$this->bootstrap('frontController');
$plugin = new My_Controller_Plugin_Layout();
$this->frontController->registerPlugin($plugin);
}
}