Automaticly Copy Zend/Symfony Library to Project

Zend Framework Batch file

@echo off
:MENU
ECHO Zend will be copied to "%CD%\library"
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E "ABSOLUTE_PATH_TO_Zend_Library" "%CD%\library"
GOTO :EOF

Symfony Framework Batch file

@echo off
:MENU
ECHO Symfony will be copied to "%CD%\lib\vendor"
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E "ABSOLUTE_PATH_TO_Symfony_Library" "%CD%\lib\vendor\"
GOTO :EOF

Read the rest of this entry »

Zend Framework : Modular Application [Part 1]

Project description : A simple guestbook module using Zend Framework 1.11 .

Project

Create new project using Zend_Tool :

zf create project MyApp
cd MyApp

Create module :

zf create module Guestbook

Create controller for Guestbook (1 = index action included):

zf create controller Index 1 Guestbook

Now go to /MyApp/application/configs/application.ini and comment/delete the line :

;resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

Then add the lines

;Modular suport
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =

And add this lines to set Guestbook as default module

resources.frontController.params.prefixDefaultModule = "1"
resources.frontController.defaultModule = "Guestbook"

Create php file “Bootstrap.php” under folder /MyApp/application/modules/Guestbook and past the code

<?php
class Guestbook_Bootstrap extends Zend_Application_Module_Bootstrap{}

Now test your app

Read the rest of this entry »