Problems creating first Zend Framework 2 project - frameworks

ZF 2 is running on MAMP. At the moment I read "Pro Zend Framework Techniques: Build a Full CMS Project" by Forrest Lyman.
If I call the project in Firefox I get the ZF 2 Welcome Page. Forrest wrote:
>
First you need to update application/configs/application.ini, adding the layout resource to the production section, as shown in Listing 2-7.
Listing 2-7. Adding the Layout Resource to application/configs/application.ini
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
<<
The module folder contains an Application folder. But there's no configs folder and no application.ini as well.
Do I have to create that?
Is there a difference between ZF1 and ZF2?

There is a huge difference between ZF 1 and ZF 2. That book was written using ZF1.8 I believe. So you will be best off using a version of ZF 1. If you use a version newer then about 1.10 there will be some areas where the original code for the book may not work as expected.
For the most part the code in that book is still very good and the information in the book is good although it would be better if you had a working knowledge of ZF 1 before trying the exercises. It is a more intermediate level book. Try Zend Framework in Action or at least Rob Allen's tutorial first.

Related

Add a web page to a site built in Zend Framework

I am a sort-of newbie with MVC and Zend in particular. I have taken over a project from another team, site is built in Zend framework. There is an admin dashboard to add content, assets like images and media, a blog and a portal into Zen Cart for the store.
What is the easiest method of adding a new web page that has as its contents several things that are dynamic - items for sale, music to listen to, blog entries, news items from the database and a featured artist. All of this is stored in the MySQL db. I just do not know enough about MVC to make it work correctly.
I can create a page in the admin dashboard and use as the URL another "module" that already exists, but if I attempt to copy a module folder (for instance the folder called musiclive is almost exactly what I need except I need to add another column of elements...) the admin dashboard does not render. I know that I need to create some sort of "view" and fiddle with or create a controller, but not sure of the easiest method of doing this. I probably have to tell the admin dashboard I have added another "module" but it really is just the main or home page of the site - the other guys never built it because it was rich with details and I guess they put it off. I also probably have to change the files inside the module folder to reflect a different page.
Would love some help or pointers. Ask if you need more details on what the heck I am describing here...
Create a new controller in that same module instead of copying the whole module if the module is so similar to your requirements. And then extend already built resources like forms, models. I strongly recommend you to read about zend framework documentation, especially skeleton application tutorial. That will increase your knowledge as well as make you understand MVC and your current project.
http://framework.zend.com/learn/
One more thing there are 2 versions of zend framework and both are entirely different. You need to know the version in which the project is built. Zend framework 2 has following generic directory structure:
config/
autoload/
application.config.php
module
Application/
config/
src/
view
Module.php
SomeOtherModule/
...
public/
vendor/

Translate Zend Framework website like WPML in Wordpress

I want to know if it's possible to translate a Zend Framework 1 website in a manner similar with the one implemented by WPML for Wordpress.
What I want is to make an application that can scan the website source code for translation variables, then store them in a database or a .po file.
Also please note that I am not interested in switching to another framework or using only Wordpress for my website but in a method of simple and easy translation for someone without programming skills.
What you need is:
Zend_Translate with gettext adapter
Zend_Registry
Poedit
More info here.
PoEdit http://www.poedit.net/download.php
I have used this software to create .mo files for Zend_Translate gettext adapter in one of my ZF projects.

Zend Framework and fuelphp

I wanted to know if it was possible to use zend framework libraries from zend 1.11 in fuelphp? fuel looks nice and I started looking at it as I believe its the next logical step for any CI developer.
Is there any site or a howto for using zend library with fuel?
Thanks
It really depends on what portions of Zend Framework you want to use. Some parts, e.g. Zend_View are tied into the MVC-part of the framework, but components like Zend_Pdf or Zend_Service_* have only few dependencies and should work fine in other frameworks as well.
What you should do is check out the Reference Manual to see what other components are required by the component you are trying to use. And then put them in a library folder. Alternatively, just put the whole Zend Framework in a folder if you don't mind carrying the dead weight with you.
I've been using ZF-components standalone and found that it's useful to add it to include_path as you would when using ZF as MVC-framework, because some ZF-classes are instantiated dynamically, i.e. not via require_once and that won't work without the folder containing Zend/ being in the include_path.
Finally you have to add the folder to your autoloader, this should be as easy as:
Autoloader::add_namespace('Zend', __DIR__.'/path/to/Zend/library');

Sample working CMS with Zend Framework

I'm looking for a sample project that uses Zend Framework so that I can see how masters do it.
I'm not looking for something that uses other stuff like smarty, or any other major library.
There are plenty of samples for different subjects on sites like zendcast.com but I need a full working solution.
I couldn't come up with anything like that by googling.
I came accross this a while ago, it has a sectoion on Central authentication
http://www.zend.com/webinar/Framework/70170000000bEs9-webinar-secure-application-development-with-the-ZF-20100505.flv
Here are the notes, look at page 9
http://static.zend.com/topics/Webinar-Zend-Secure-Application-Development-with-the-Zend-Framework.pdf
Is this a good idea?
We are making a full open source CMS, based on Zend Framework: Centurion CMS (http://www.centurion-project.org/).
We are working on it since more than 2 years. The project is under the new BSD licence.
Feel free to try, use, pull feature, make some push request, criticize...
If you have any question use the our Google group: http://groups.google.com/group/centurion-project
Social Engine 4 is what you are asking for but its not free nor open source . The best application ever created using ZF has became even more popular then Zend itself (google trend) its known as "Magento". Its open source and based on best programming practices (design patterns) .
Social Engine 4 projects are built on Zend Framework.
Social Engine 3 used smarty but they decided to move to Zend.
Have a look at TomatoCMS
Pro Zend Framework Techniques: Build a Full CMS Project
I think this book will be useful for you.

Create admin module and configuration in Zend Framework 1.9.0

I am working with zend framework for last 2 months. I got zend framework latest version 1.9.0.
I am new in zend framework programming. I am learning one by one.. in zend framework. Now i am confused with creating admin module in zend and their configuration settings. Please help me to create admin module with in the module folder in zend framework.
Thanks and regards,
Prasanth P
Using Zend_Tool you can create modules.
zf create module name
I did have a few issues when creating modules these two blogs were a great help (few articles on each). I was looking to have separate configs, layouts ect for each one, maybe not what you're after but good read anyway.
http://blog.vandenbos.org/2009/07/07/zend-framework-module-config/
We have a similar problem:
I am designing a large scale application with about 5 modules.
Even though I am not finding my way around, I think this blog post http://blog.astrumfutura.com/archives/415-Self-Contained-Reusable-Zend-Framework-Modules-With-Standardised-Configurators.html might be helpful for you and for anybody else. Please, update this thread if you find anything interesting. thanks.
use of this
http://www.skyrocket.be/2009/01/11/admin-cms-routes-in-zend-framework/