Is it necessary to learn Zend Framework before learning Magento? - zend-framework

i am newbie in Magento and wants to learn Magento effectively. i know Maegnto is based on zendframe work. i have not worked in Zend framework before.
Is it necessary to learn Zend Framework before learning Magento ??

It is not necessarily required to learn the Zend Framework before.
But it sure helps if you understand the general paradigm of Model View Controller (MVC) to get a better grasp of the system.
While Magento relies heavily on the Zend Framework, it does things its own way in many aspects, so if you want to learn Magento, I would recommend diving right into learning Magento and learning Zend framework on the way where appropriate.
Good in depth tutorials to get started as a developer are:
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-1-introduction-to-magento

No.
While it would be helpful, I've practically learnt Magento from not knowing anything beyond Python and C#. Programming knowledge and HTML/CSS knowledge is useful, but you don't need to know the in's and out's of the framework to be able to use it.

Related

Play 2 Framework code generation tool or Yii/Cakephp frameworks?

I'm trying to get started with a couple of web applications. However, choosing a framework to work with can be overwhelming!
I've worked with Java in the past, and since I do C# .NET at work, I don't mind learning and extending my Java knowledge. Now, the only framework that seems to work without jsp and other applet things that I've never understood is Play 2 Framework. I downloaded this framework, put the executable file in my path, and it seems that it would work for me. However, I came across CakePHP and Yii frameworks (I'm sure there is more) and notice there is a code generation tool that gets the database and automatically generates the models for you + the CRUD and such. Geez that is a save of time.
I went and googled my question and got that this is also possible in Play Framework (bummer only found the module for 1.x framework.)
How to quickly generate models in play framework 1.2?
http://www.playframework.org/modules/db
So, my question is...
Is there a module that would easily let you do this work in Java Play 2.0 Framework as in the mentioned PHP frameworks?
If no, would it be worthy (any advantages) to stick to the Java Framework?
If no, what php framework or even python (but Ruby) framework you consider has the best tools like this auto completion feature? I don't mean learning a new language, I will have to anyways. But rather to learn a language I can do things other than web development (for Ruby I know you can do more stuff but it might be just a waste of time to learn that other language. However, learning Python, Java, would open up app and phone development as well)
Don't mean to open a debate, please be concise (not like me) in your answer. Thanks!
From personal experience, there's several difference in both frameworks, particularly the way models are handled in cake vs yii.
In cakephp you cannot use composite primary key, this is the main deal-breaker for me. Composite primary key is supported in Yii.
Cakephp enforces convention, while yii favors convention, you are not forced to follow a certain standard.
Out of the box performance, I think yii has the advantage, but as with performance tuning, with proper cache configuration, and as long as you are careful in using the ActiveRecord patterns, they are not that much apart
As a side note, I have lead web app implementation with both CakePHP and Yii, the feedback that I got from the team was that the less experienced team preferes CakePHP, while Yii is preferred by the more experienced team. Make of that what you will.
Well it can turn out to be a very long debate. Each has its own life. So far from Experience I have found Yii to be most promissing than everyone. For me it matters who gives more work in less time. Cake is a bit heavy but Yii is light weight framework. I am from .Net Background but it took mew few weeks to get going with Yii

Zend Framework or Symfony

I am in the process of migrating to a new PHP Framework. I have been involved in heavy development using the CodeIgniter Framework, but I am finding it a little too lightweight for my needs now.
I have boiled my choices down to either Zend Framework or Symfony. I know the learning curve for both is relatively high. However, I just wanted to get a rough idea of which will be worth getting stuck into (as I will be spending quite a lot of time getting familiar with the chosen framework).
If it helps narrow the answer down a little. I am not looking to build a simple blog or anything like that. I am in need for something that will support full-fledged development of e-commerce systems, customer relationship managers and content management systems.
Personally i have been working with ZF since it was in version 1.6, and i am pretty happy with it , I had seen very good improvement since 1.6 , but i think ZF missing some ideas :
1- ORM and later on very great implementation between ZF + Doctrine 1.2 has taken very popularity
and i honestly depend on ZF + Doctrine in many projects
and these days we can see great integration between ZF + Doctrine2
2- the symfony's bundle is completely forgotten in ZF
Do you think Zend framework misses the Symfony's Bundle principle ?
and i think its really indeed to see it soon (hopefully in ZF 2 )
3- i had many good points about symfony 1
- doctrine built in support
- bundle principle
- admin generators which can save a lot of time
- symfony plugins is very popular
- symfony documentation is really good
finally , i had took a deep look at symfony 1 but i am really taken by the buzz of symfony2 in the late of 2010 and till today its public preview http://symfony.com/download
and i am trying to spend some time learning it .
wish me luck :)
update
I don't want my answer to imply that ZF isn't good or symfony is better than ZF , ZF IMO very powerful library and being ZF developer === advanced + powerful PHP OOP programmer .
I had to make this choice about 1.5 years ago. I first looked at ZF and read up on it as much as possible, but at the end of the day I never really felt comfortable with it. It felt over-engineered, and I found myself getting lost in the code pretty often. I then checked out Symfony with Doctrine. I was able to come to grips with the code base much quicker than ZF. I've since used Symfony on 30+ projects, everything ranging from small sites to pretty large applications and I couldn't be happier. Their admin generator tools have cut down the time I spend building CMS's by a ridiculous amount, and I'm constantly adding my own additions so that future projects take even less time. On top of that, their routing framework, forms framework, and plugin architecture are very well built and very useful. (And Doctrine is a God-send, but you can use that with ZF as well, it's just nice that Symfony uses it by default and has some tighter integration with it.)
Luckily, both ZF and Symfony are highly extensible, so whichever you choose, you'll be better off than using CodeIgniter.
Personally I would rather invest my time in learning the Zend framework. I've played with symfony in the past, and it does have its merits, but I like the Zend framework better. For me Symfony (1.x) has that "things patched together with duct tape" feel around it. There's a lot of different plugins, with varying code quality. ZF tries to raise the bar and feels like a more professional, and well thought out framework (and on top of that ZF is very flexible). Symfony might be better suited for prototyping though because of the admin generator.
I haven't looked at Zend, but I did look at a couple of other frameworks before deciding on symfony.
For me it was the quality of the documentation - which for Symfony is excellent.
The thing with frameworks is that if you cannot use features because they are not well documented then they are not features at all.
It really boils down to your own requirements and how each feels - as you know the whole point of a framework is to work with it, if you are always adding extra code or exceptions then that framework is not right for you.

How to integrate zend framework in an existing website

I'm currently learning Zend Framework and now I am looking for a way to integrate it into an existing website. This website is coded in an extremely complex spaghetti way, and I am hoping that it will be easier to read by integrating it into Zend and slowly refactor it. How could i run legacy code and the zend framework + mod_rewrites side by side?
Greetings,
Bas
Since you don't give any information on how your current site is structured, there's absolutely no way to answer this question.
Some guidelines though : make sure you first tackle routing, you could probably solve this by including your current scripts in the relevant controller actions. After routing is ok, you can have a look at rewriting the interactions so you use ZF's Zend_Request/Response and afterwards start integrating other Zend Framework functionality (ie. Zend_Acl/Zend_Auth for user permissions and authentication).
BTW It might be a lot easier to start from scratch and do a clean rewrite, picking up pieces of existing code as you go...

Zend Framework - Ruby on Rails has a screencast showing how to code a blog in 15 minutes. Does ZF have a similar screencast?

Ruby on Rails has a screencast presentation they use to promote their framework that shows how to code a basic weblog system in 15 minutes with RoR. Does the Zend PHP Framework have a similar screencast/presentation/whatever demonstrating something similar? It doesn't have to be a blog specifically, but I would definitely like to find a presentation that shows some rapid application development using ZF.
Where I'm coming from: I have been programming on and off for years now. I started out with QBASIC waaaaay back in the day making little programs (text adventure games, screensavers, simple little things). I then moved to C++ but never really did anything too impressive with it. Since then (probably 5 years or so now) I have started to use C# for my desktop development and PHP for my web development. I've made some pretty cool tools here and there, but am certainly not a professional programmer by any stretch of the term as it has always simply been a hobby of mine.
Right now I have two major web applications that I will start work on shortly. (Like tomorrow, or later tonight ideally.. :) ) Both will be database-driven apps that will require user registration, the ability to manipulate data that is specific to their account (their posts, listings, user account details, etc), amongst other things.
Currently I am evaluating different frameworks to help me develop these web apps more quickly. I've been looking at, and have heard good things about Ruby on Rails. Hulu and YellowPages.com using it is an obvious endorsement - Of course, I have heard about the scalability issues that it potentially has; but that shouldn't be an issue with what I am working on. I don't expect millions of users per day for either project.
I am also seriously looking at the Zend Framework for my needs because I already have some experience with PHP. Ideally I would like to find a ZF screencast that shows an app being written quickly so that I have a roughly equal comparison between the two options I am exploring and can see first-hand how things get done in both.
That said - I am not opposed to considering frameworks other than RoR or ZF. The only research I've done on the subject has been over the past couple of days so I am quite certain that there are other excellent options out there that I've not even looked at - or heard of. Of course, it'd be awesome if there is a rapid app dev presentation that I can watch for whatever else is suggested.
So - Suggestions? Links to good screencasts that show rapid application development in other frameworks? Are there other PHP frameworks that I should be considering? (Ones that are easy to deploy would be ideal, so I don't have to purchase a dedicated server that I have full control over. I'd like to keep my hosting costs down assuming that it's reasonable)
Thanks in advance!
-Sootah
You can checkout ZendCasts.com
However, when deciding between ZF and RoR, you should be aware that they are very different from each other. RoR is a full stack with integrated ORM built on AR and a rather rigid structure. It's powerful and there is lots of magic inside and I'd say it's RAD capabilities are above ZF due to rake being more powerful than Zend_Tool
ZF, on the other hand, is first and foremost a loosely coupled component library with a use-at-will architecture for maximum flexibility. You can use it's components together, but you don't have to. While it does feature convention over configuration, ZF doesn't take you by the hand too much. It expects you know how to walk. Also ZF has no full fledged ORM and no AR, but you can very much integrate Doctrine or Propel or whatever library you like to use.
You often hear folks new to ZF complain about it is hard to get into it, simply because they expect ZF to work like RoR or Symfony or Cake, e.g. a full stack framework
EDIT:
Cake aims to be a port of RoR to PHP. It is built around ActiveRecord. Like CI < v2, it is backwards compatible with PHP4, which means it doesn't fully utilize the OOP capabilities you get in PHP5. I'd say both are easier to get in than ZF though.
This is a common question on SO.
I posted some valuable links in my response to this post
If you Google for such tutorials, look for Zend Application or Zend Tool, not ZF.
The difference between the other frameworks and Zend Framework is that Zend Framework is rather a general purpose framework, not application framework (not only for MVC, HTTP). E.g. Google uses ZF to provide access to their services.
You may easily use Symfony or CodeIgnitier with Zend Framework together.
BTW, To be precise, tutorials you ask are not blogs, but just a simple CRUD controllers. You may use Wordpress to create blog in 15 minutes, (then customize it) but not a PHP Framework.

Difficulties when learning Zend Framework 1.8

I am a newbie of Zend Framework.
I downloaded the Zend Framework and then followed the official quickstart tutorial to build a very simple registration form. But after that, I find very hard to learn different elements of Zend Framework.
Many tutorials mention frontController and registerAutoload() in the bootstrap file. However, it seems that I can't see it again in the code in version 1.8 (both in the official quickstart tutorial and Getting Started with Zend Framework 1.8). Many tutorials contain the old version of code and it seems very different in v1.8.
I start with writing registration form with password confirmation. I read the official document and find the custom validator for password confirmation. It just puts the class there and doesn't mention how I can use it. I don't know where I should put this file and I can't find any hints in Google. The "class not found" error always makes me sick (I've tried addPrefixElement, set_include_path but they don't work).
User registration, email activation, login, access control are very common tasks. But I don't even find a piece of sample code in v1.8 that I can run in my machine. I am very frustrated about Zend Framework.
Does anyone give me some advices?
I have also just started learning the zend framework. I also find alot of old tutorials that make learning confusing and hard,
but there are some resources that I find help in learning the zend framework:
http://www.zendcasts.com/ - they have tutorials on ZF1.8 already, like Bootstrapping using Zend_Application, etc.
Some useful blogs that might help:
http://weierophinney.net/matthew/
http://www.thomasweidner.com/flatpress/index.php
http://smartycode.com/zf/
http://codeutopia.net/blog/
Forums to ask your questions:
http://www.nabble.com/Zend-Framework-Community-f16154.html - alot of ZF developers seem to be here to answer your questions :) much more than the official Zend Forums below ...
http://forums.zend.com/viewforum.php?f=69
As to class not found, I think you didn't autoload?
http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html
Parts of Zend Framework have changed slightly in the 1.8 release but everything should be backwards compatible so all code example written using the 1.* release series should still work with little or no modification. The main areas that are different are
Zend Loader (related to register_autoload) which now has several improvements related to performance and some slight differences in its API (with a PHP warning if you use the old way). I wouldn't worry about this too much as a beginner - just follow the tutorial or continue to use include/require statements until you become annoyed with adding them all the time!
Zend Application which basically allows you to create your set-up and initialisation code with less fuss. Again, you don't have to use it and you can happily write a manual bootstrap class to get you used to how the framework is put together.
With regards to getting started I would highly recommend getting your head around the Zend Controller component, particularly the front controller part and this diagram.
For authentication look at Zend Auth, for e-mail see Zend Mail, for access control see Zend Acl and for forms and validation see Zend Form, Zend Validate and Zend Filter. The form and validation components will explain about paths and adding your own custom validators and form elements.
The other area of importance is Zend Db which allows you to persist your data to a database. There is also Zend View which represents the view layer in the MVC stack. In my opinion these are the key components of a basic ZF application. From there you can explore the other components as and when you need them.
Don't forget that the Zend Framework is specifically designed to be loosely coupled and it is very easy to use a different component from another project for a particular task. Sometimes it is necessary to write your own components too. If there is a component you would prefer to use over the Zend component then go ahead and do so.
Honestly, the documentation is very good although it is hard to navigate for beginners. Once you get your head around the core components everything will become a lot clearer.
Also try following this tutorial. It will help explain a lot of the basics.
I recommend these video tutorials pu up by a guy called Alex, he keeps them up to date and releases new ones all the time,they are all relevant to ZF 1.8 and 1.9.
He has even a detailed video tutorial covering ACL, login forms etc. (my first steps with Zend were easier thanks to him!)
http://alex-tech-adventures.com/development/zend-framework.html?start=15
- his site is a bit comfusing but worth the time in figuring it out :)
Cheers
Roman
Some tips:
Here is a nice diagram of the Dispatch process
http://nethands.de/download/zenddispatch_en.pdf
It is much easier to understand ZF if you are experienced in OOP / OOP Design Patterns
When I first stumbled across ZF I had little knowledge of OOP. ZF prompted me to learn OOP which was a very good thing.
Distinguish between the 'magic' of ZF and the actual ZF Architecture
Although I have a good understanding of ZF Classes I still get confused when ZF adds its 'magic' to the mix.
When I say 'magic' I am referring to things like
the default objects loaded and used if none specified, and
url-controllername-filepath-filename inflections / naming conventions.
config settings-to-class-instantiation mappings
ZF is a bit like a crack-dealer in the sense that the 'Getting Started Tutorials' get you hooked straight away. They perform so much magic that it makes you think
.oO(Wow - how simple was that! This framework is cool!)
Then as soon as you start to try to do your own thing - the magic starts to get really confusing.
So - my tactic is to remove as much ZF magic as possible. If you have the option to specify a class to use, or a router to use, then specify it. Don't let Zend do it for you.
Then when something weird is happening you can find the bugs more easily.
Also, if you specify the locations of classes/ paths as (opposed to letting ZF magically inflect paths and find scripts), then you do not have to worry about questions of 'where to put this? , where to put that?' - you just put things where you want them to be and explicitly point ZF to them.
As you get more familiar with ZF you might then want to let it take over and do some magic for you. Only then can you really understand why that magic is convenient.
As Tim Wardle said in another answer - favour require statements over zend loader until you really need it.
If you are a PHP design house that churns out 10 website projects a week, then ZF Magic can be really useful. If you are designing your first ZF app - then 'reducing complexity' is a more important design goal than 're-usability'.
Browse the code
It might seem obvious but one of the best ways to learn about the ZF is to look at the code.
Again the ZF magic can get in the way - I often want to look at a method's arguments to discover what i need to pass in only to discover that it expects an ambiguous 'options array' (not exactly helpful). After a while, though, you start to notice the conventions used in how an 'option key' marries up to a getter/setter method. So, keep looking at the code and familiarising yourself with the 'ZF way'.
I 'ope that 'elps.
The Front Range PHP Users Group website has some presentations on Zend Framework which may be of use.
I have so much sympathy with you Billy. I am a newbie and the confusion between the old way and the new way is almost just too much to handle. Also see here for someone who points out some of the main differences:
http://crossfunctional.wordpress.com/2009/05/
All documentation, particularly Zend's documentation is absolutely horrible. It all assumes that you "know" where to put the snippets they are referring to and how they work together. If I already knew those things, I wouldn't need the documentation. No full example applications with authentication etc. that you can download and modify. I'm seriously regretting putting any time into trying to learning this framework. All examples that I can find are apparently for older versions. I followed one for authentication on youtube that was designed for 1.8 to the letter. It fails to work in 1.9.x. Can't get it to work for the life of me. Completely frustrated with Zend Framework!
Zend Framework has shifted from being a relatively accessible and simple system to a more complex entity. It has gone through a number of rapid developments over the past couple of years which have left a lot of older documentation around.
We have projects that are stuck on Version 1.7.x because the differences between that and the latest version are too great which makes the dev and testing time too expensive.
I like Zend Framework because it has so much depth to it but it is definitely a two edged sword for beginners.
I'd certainly recommend making use of the expertise of other users and search out some simple framework examples. ZF is highly adaptable but you need to try and work from the simplest case possible for your needs.
I think Matthew Weier o'Phinney, (search for 'Phly, boy, phly') is one of the more approachable members of the dev team and has loads of examples and ideas on his website.
Good luck!