HTTP/1.0 200 OK Accept-Ranges: none Content-Location: http://www.evilprofessor.co.uk/tag/module/ Content-Type: text/html; charset=UTF-8 Date: Sun, 04 Sep 2011 06:55:28 GMT X-Frame-Options: ALLOWALL Set-Cookie: PREF=ID=5511a5e48df50142:TM=1315119328:LM=1315119329:S=gk8oxPw-qDVO_j2v; expires=Tue, 03-Sep-2013 06:55:29 GMT; path=/; domain=translate.googleusercontent.com X-Content-Type-Options: nosniff Server: HTTP server (unknown) Cache-Control: private X-XSS-Protection: 1; mode=block Expires: Sun, 04 Sep 2011 06:55:28 GMT Evilprofessor.co.uk »-Modul

Posts tagged: Modul

Zend Framework pro Modul Layout-Einstellungen - Follow Up

Mit , Dienstag 16. Februar 2010 08.48 Uhr

Als Follow-up zu meinem vorherigen Post auf pro Modul basiertes Layout-Einstellungen für Zend Framework , ich habe den Code zu verlangen, aktualisiert weniger Konfiguration dann vor (nicht, dass es notwendig mehr als ein paar Zeilen in Ihre Applikation Konfiguration!).
Continue reading 'Zend Framework pro Modul Layout-Einstellungen - Follow Up' »

Zend Framework Per-Module basieren Einstellungen

Mit , Freitag 1. Januar 2010 10.40 Uhr

Ich habe eine Antwort auf diese Stelle, die weniger Konfiguration erfordert erstellt, siehe Module Based Layout - Zend Framework .

Bei der Verwendung des Zend Framework mit Modulen, ist offensichtlich, dass, wenn Sie verschiedene (Sub-) Seiten sind aus der gleichen Anwendung, die Sie wollen nicht unbedingt das gleiche Layout Skripte für jeden Teil. Ich beschloss, mit den folgenden Website-Struktur gehen:

  / Application
     / Controllers
         ...
     / Modelle
     / Modules
         / Default
             / Controllers
             / Layout
                 / Scripts
             / Views
                 / Scripts
         / AnotherModule
             ...
     / Scripts

Das Problem war die Einrichtung des Layouts Skripte auf einem pro Modul. Die Antwort kam durch den Einsatz einer Aktion Helper. Einrichten des Layouts auf einer pro Modul umfasst drei Schritte:

  1. Application.ini (oder ähnliche Konfiguration Setup):
      admin.resources.layout.layoutPath = APPLICATION_PATH "/ modules / admin / layouts / scripts"
     default.resources.layout.layoutPath = APPLICATION_PATH "/ modules / default / layouts / scripts"
     member.resources.layout.layoutPath = APPLICATION_PATH "/ modules / member / layouts / scripts"
     affiliate.resources.layout.layoutPath = APPLICATION_PATH "/ modules / affiliate / layouts / scripts" 
  2. Erstellen Sie Ihre Aktion Helper:
      <? Php
     / **
      * Setzt das Layout Pfad auf einem pro Modul
      *
      * @ Author Lloyd Watkin <lloyd@evilprofessor.co.uk>
      * @ Seit 2010-01-01
      * /
     Klasse Pro_Controller_Action_Helper_SetLayoutPath
         erstreckt Zend_Controller_Action_Helper_Abstract
     {
         / **
          * Setzt Layout-Pfad basierend auf Modul
          * /
         public function preDispatch ()
         {
        	 $ Module = $ this-> getRequest () -> getModuleName ();
    
    	     if ($ bootstrap = $ this-> getActionController ()
    	                        -> GetInvokeArg ('bootstrap')) {
    
    	         $ Config = $ bootstrap-> getOptions ();
    
    	         if (isset ($ config [$ module] ['Ressourcen'] ['layout'] ['layoutPath'])) {
    	             $ LayoutPath =
    	                  $ Config [$ module] ['Ressourcen'] ['layout'] ['layoutPath'];
    	             $ This-> getActionController ()
    	                  -> GetHelper ("Layout")
    	                  -> SetLayoutPath ($ layoutPath);
    	         }
        	 }
         }
     } 
  3. Und schließlich Bootstrap der Action Helfer:
      ...
         / **
          * Richtet Layout Skripte auf einem pro Modul
          * /
         protected function _initLayoutHelper ()
    	 {
    	     $ This-> bootstrap ('frontController');
    	     $ Layout = Zend_Controller_Action_HelperBroker:: addHelper (
    	         neue Pro_Controller_Action_Helper_SetLayoutPath ());
    	 }
     ... 












Panorama Theme by Themocracy

6 Besucher jetzt online
4 Personen, 2 Bots, 0 Mitglieder
Max Besucher heute: 14 um 12:40 UTC
Diesen Monat: 17 am 2011.01.09 11.27 UTC
Dieses Jahr: 130 am 28-03-2011 10.40 UTC
Insgesamt: 130 am 28-03-2011 22.40 UTC