Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/10/2011, 09:00
RobinHead
 
Fecha de Ingreso: junio-2009
Mensajes: 9
Antigüedad: 14 años, 11 meses
Puntos: 0
Pregunta Modular Bootstraping

Estimados, estoy tratando de hacer una aplicación completamente modular.

Tengo el siguiente problema.

En mi /application/Bootstrap.php tengo

Código PHP:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

en mi modulo default /application/modules/default/Bootstrap.php

Código PHP:
class Default_Bootstrap extends Zend_Application_Module_Bootstrap
{
    
    protected function 
_initViewHelper(){
        
$viewRenderer =  Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
        
$viewRenderer->init();

        
$this->_view $viewRenderer->view;
        
$this->_view->headLink()->appendStylesheet('/css/hoja-estilo-default.css');
    }

y en mi modulo foo /application/modules/foo/Bootstrap.php

Código PHP:
class Foo_Bootstrap extends Zend_Application_Module_Bootstrap
{
    
    protected function 
_initViewHelper(){
        
$viewRenderer =  Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
        
$viewRenderer->init();

        
$this->_view $viewRenderer->view;
        
$this->_view->headLink()->appendStylesheet('/css/hoja-estilo-foo.css');
    }

entonces cuando cargo misitio.com/foo lee el bootstrap del modulo default tambien por lo que el código html queda.


Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Zend App</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<meta http-equiv="Content-Language" content="es" >
<link href="/css/hoja-estilo-defualt.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/css/hoja-estilo-foo.css" media="screen" rel="stylesheet" type="text/css" >
</head>
<body>
    <div style="text-align:center">
    <h1>Foo Module</h1>
</div>
</body>
</html> 
Lo que no quiero es que cuando estoy en mi modulo Foo solo lea los recursos de ese modulo.

Espero que se entienda el problema y alguien pueda aportar.

Gracias