Book Image

Instant Zend Framework 2.0

By : A N M Mahabubul Hasan
Book Image

Instant Zend Framework 2.0

By: A N M Mahabubul Hasan

Overview of this book

Zend Framework 2 is a modern object-oriented PHP framework. It has lots of useful components, which are easy to use and user friendly, helping you get your job done faster. This book shows you how to use the framework components to build a practical MVC application. Topics covered in this application include validation, file upload, database CRUD (create, read, update, and delete) operations, and so on.Instant Zend Framework 2.0 has been specifically created to provide you with all the information that you need to get up with Zend Framework 2 applications. You will learn the basic of Zend Framework 2.0, and get started with building your first Zend Framework MVC application. The book promises to deliver all the information you need to get started with Zend Framework 2.0. Instant Zend Framework 2.0 starts with how to download Zend Framework 2.0 and the skeleton application, and then shows how to configure the skeleton application to use the Zend Framework 2.0. Then it takes you through step-by-step instructions of how to create and configure modules, controllers, views, models, helpers and so on. By following the instructions in the book, you will be able to build a small fully functional database-driven MVC application. You will also learn how to use different framework components like the event manager, Zend log, and how to configure them with the module. This will give you an idea of how to configure any component with the module. After finishing this book you will be able to build a small database-driven web application with Zend Framework 2.
Table of Contents (7 chapters)

So, what is Zend Framework?


Throughout the years, PHP has become one of the most popular server-side scripting languages on the Internet. This is largely due to its steep learning curve and ease of use. However, these two reasons have also contributed to many of its shortcomings.

With minimal restrictions on how you write code with this language, you can employ any style or structure that you prefer, and thus it becomes much easier to write bad code.

But there is a solution: use a framework!

A framework simplifies coding by providing a highly modular file organization with code libraries of the most common scripting in everyday programming. It helps you develop faster by eliminating the monotonous details of coding and makes your code more re-usable and easier to maintain.

There are many popular PHP frameworks out there. A number of them have large, open source communities that provide a wide range of support and offer many solutions. This is probably the main reason why most beginner PHP developers get confused while choosing a framework.

I will not discuss the pros and cons of other frameworks, but I will demonstrate briefly why Zend Framework is a great choice.

Zend Framework (ZF) is a modern, free, and open source framework that is maintained and developed by a large community of developers and backed by Zend Technologies Ltd, the company founded by the developers of PHP.

Currently, Zend Framework is used by a large number of global companies, such as BBC, Discovery, Offers.com, and Cisco. Additionally, many widely used open source projects and recognized frameworks are powered by Zend Framework, such as in the case of Magento, Centurion, TomatoCMS, and PHProjekt. And lastly, its continued development is sponsored by highly recognizable firms such as Google and Microsoft.

With all this in mind, we know one thing is certain—Zend Framework is here to stay.

Zend Framework has a rich set of components or libraries and that is why it is also known as a component framework. You will find a library in it for almost anything that you need for your everyday project, from simple form validation to file upload. It gives you the flexibility to select a single component to develop your project or opt for all components, as you may need them.

Moreover, with the release of Zend Framework 2, each component is available via Pyrus and Composer. Pyrus is a package management and distribution system, and Composer is a tool for dependency management in PHP that allows you to declare the dependent libraries your project needs and installs them in your project for you.

Zend Framework 2 follows a 100 percent object-oriented design principle and makes use of all the new PHP 5.3+ features such as namespaces, late static binding, lambda functions, and closures.

Now, let’s get started on a quick-start project to learn the basics of Zend Framework 2, and be well on our way to building our first Zend Framework MVC application.

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.