Zend Framework: Creating Layout

I continued Zend learning with 3rd page of Zend documentation. It is about creating Layout. In this section, I saw mention about two design patterns about Layout. This layout section introduced one more command: enable layout.
C:\xampp\htdocs\ZendFramework\demos>C:\xampp\htdocs\ZendFramework\bin\zf.bat enable layout

This was giving error.

An Error Has Occurred
Action 'enable' is not a valid action.

The above error is coming to all XAMPP user as I read in comments submitted by users there. Xampp comes with it own Zend library. So, I got to rename that for making the above command work.
One comment says that you need to add PATH in window to C:\xampp\php. But, this I have done in previous chapter. So, I have tried with renaming the Zend version of PEAR at C:\xampp\php\PEAR and it is working fine. Now, check the 'zf show version' command again. The output should be different.

What if, I run zf enable layout again! Can zend check that layout already exist and give me option or warn me? No, it did not. Instead it overwritten the layout.phtml and created duplicate entry in
application.ini for layout (resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"). It is not perfect.

While learning, I was thinking - Is this learning will be of any use? or I will just learn and forget it and letter some another framework will come and my employer will expect me to know that!

  • # 1 - by Sean Hanford

    Have you tried installing the Zend Server on your computer? I chose to do that instead of XAMPP as I am working with Zend Framework full-time. The community version is free, so there is no worry about cost. I think that you are wise to continue teaching yourself ZF as it is an MVC framework nonetheless, so as long as you are able to master this kind of framework, any other that your employer is interested in, you will be able to learn quickly.

    There are a number of good resources on the web for teaching yourself ZF, here are a couple that I have used:
    Zend Framework: Surviving The Deep End – http://www.survivethedeepend.com/zendframeworkbook/en/1.0

    Zend Framework Community Wiki – http://framework.zend.com/wiki/display/ZFUSER/External+Resources

    Zend Framework Tutorials – http://phpdev.ro/zf-tutorial-series-part-1-module-based-app.html

    Zend Framework Screencasts – http://www.zendcasts.com

    I hope these help you in your mastery of Zend Framework.

    – Sean

  • # 2 - by Satya Prakash

    @Sean Hanford
    Nothing is easy for tech guy. I have learnt Symfony. I cannot see much similarity here. After command, classes name and methods will be different. Even structure will also be different even it is MVC. So, only learning learning without much use. Even I do not know how much will be easy Symfony for me after 3 years of learning!
    Only good thing about the ZF framework that it is in demand these days.

  • # 3 - by Satya Prakash

    @Sean Hanford
    and about Zend Studio, ya I found it good to look at there as well. but thought to learn ZF first. I do not know what other changes I need to do in my system. Like my php+Mysql+Apache installation will be there or not! Thanks for the comment though.

  • # 4 - by jayantha

    thank you for your guide .it is very help full for the self study

Comments are open for an year period. Please, write here on Facebook page.