Zend FR

Consultez la FAQ sur le ZF avant de poster une question

Vous n'êtes pas identifié.

#1 28-09-2010 10:56:00

Denis. Beurive
Membre
Date d'inscription: 06-06-2009
Messages: 35

Outil zf.sh - Peut-on défaire ce que l'on a fait?

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 :

Code:

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

Code:

cp .zfproject.xml zfproject1.xml

Code:

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'

Code:

cp .zfproject.xml zfproject2.xml

Code:

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

Code:

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'

Code:

cp .zfproject.xml zfproject3.xml

Code:

diff zfproject2.xml zfproject3.xml
30a31
>           <actionMethod actionName="send"/>
66a68,70
>           </viewControllerScriptsDirectory>
>           <viewControllerScriptsDirectory forControllerName="Test1">
>             <viewScriptFile forActionName="send"/>

A+

Hors ligne

 

Pied de page des forums

Propulsé par PunBB
© Copyright 2002–2005 Rickard Andersson
Traduction par punbb.fr

Graphisme réalisé par l'agence Rodolphe Eveilleau
Développement par Kitpages