Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour à tous,
J'utilise l'outil "zf.sh" pour générer les différents éléments qui constituent mon site WEB sous l'implémentation MVC de ZEND (ZendFramework-1.10.8).
Cet outil est très pratique au départ, mais j'ai l'impression que l'outil ne permet pas de défaire ce que l'on a fait. Je m'explique :
Vous créez un contrôleur avec la commande suivante :
zf create Controller Test1 Creating an index action method in controller Test1 Creating a view script for the index action method at /home/services/db-cdr/www/quickstart/application/views/scripts/test1/index.phtml Creating a controller test file at /home/services/db-cdr/www/quickstart/tests/application/controllers/Test1ControllerTest.php Updating project profile '/home/services/db-cdr/www/quickstart/.zfproject.xml'
Question : Peut-on, grâce à cet outil, effacer le contrôleur que l'on a créé? Peut-on, éventuellement, le renommer?
Actuellement, je modifie directement le fichier ".zfproject.xml"... C'est vraiment pénible. L'outil stocke la structure de site sous la forme d'un fichier XML. Il ne devrait pas être nécessaire de modifier à la main ce fichier. Aussi, je pense que j'ai dû passer à côté d'une documentation importante.
Pour information, voici la méthode que j'utilise pour identifier les modifications apporter par l'outil au fichier XML.
Création d'un contrôleur
cp .zfproject.xml zfproject1.xml
zf create Controller Test1 Creating an index action method in controller Test1 Creating a view script for the index action method at /home/services/db-cdr/www/quickstart/application/views/scripts/test1/index.phtml Creating a controller test file at /home/services/db-cdr/www/quickstart/tests/application/controllers/Test1ControllerTest.php Updating project profile '/home/services/db-cdr/www/quickstart/.zfproject.xml'
cp .zfproject.xml zfproject2.xml
diff zfproject1.xml zfproject2.xml 28a29,31 > <controllerFile controllerName="Test1"> > <actionMethod actionName="index"/> > </controllerFile> 61a65,67 > <viewControllerScriptsDirectory forControllerName="Test1"> > <viewScriptFile forActionName="index"/> > </viewControllerScriptsDirectory> 99a106 > <testApplicationControllerFile filesystemName="Test1ControllerTest.php"/>
Création d'une action
zf create action send Test1 Creating an action named send inside controller at /home/services/db-cdr/www/quickstart/application/controllers/Test1Controller.php Updating project profile '/home/services/db-cdr/www/quickstart/.zfproject.xml' Creating a view script for the send action method at /home/services/db-cdr/www/quickstart/application/views/scripts/test1/send.phtml Updating project profile '/home/services/db-cdr/www/quickstart/.zfproject.xml'
cp .zfproject.xml zfproject3.xml
diff zfproject2.xml zfproject3.xml 30a31 > <actionMethod actionName="send"/> 66a68,70 > </viewControllerScriptsDirectory> > <viewControllerScriptsDirectory forControllerName="Test1"> > <viewScriptFile forActionName="send"/>
A+
Hors ligne
Pages: 1