Category:: zend framework 2

Zend Framework 2 Advanced database operations ?

In this post i would like to list basic to advanced database queries using ZF2. I am gonna use TableGateway methods here. Simple Select Query SQL statement is Select Query with Where condition SQL statement is Select Query […]

How to return JSON response in Zend framework 2

In this post i just want to show you how to return response in JSON format in the correct way in ZF2.Returning JSON response is very useful and we almost use for all AJAX integrations. Lets see the below example for better […]

How to configure multiple databases in zf2

Configuring multiple databases adapters in zf2 is pretty easy. In this post i will show you how to configure and connect to different databases in zf2 application. Adapter Abstract Service factory(Zend\Db\Adapter\AdapterAbstractServiceFactory) […]

How to create your own controller plugin in ZF2?

Our step-by-step guide explains how you can create your own controller plugin in zf2.Fortunately creating controller plugin is very easy task. Create a directory called plugin in your module controller directory, then […]

Zend Framework 2 installation on Xampp ?

In this tutorial i will cover the ZF2 installation on xampp for windows operating system. 1.First you need to download and install xampp server from apachefriends 2.Download and install GIT from Download GIT 3.Download […]

How to Create Custom View Helper in ZF2

In this post I will show you how to create a custom view helper in ZF2, writing custom view helper in zf2 is very easy thank to zf2 authors. Here in this example i am goanna create StaticFileVersioning Module, you can […]

How to Send HTML Mail Using Zend Framework 2 (ZF2)

ZendMail provides generalized functionality to compose and send both text and MIME-compliant multipart email messages. Mail can be sent with ZendMail via the MailTransportSendmail, MailTransportSmtp or the MailTransportFile […]

How to Get Last inserted ID in Zend Framework 2?

We often need last inserted ID for different reasons(for example when you need to store foreign key), Immediately after a record has been inserted into the database, you can get the id that was auto incremented(primary […]

How to redirect to 404 page in zend Framework 2

The Zend framework automatically does this if the user selected route doesn’t exists. Although in some situations like getting data from database where the route is valid , but response is 404 (row not exits or may be […]

How to Create,Get,Check Sessions in Zend Framework 2?

In GF2 in order to use Sessions we should use this use ZendSessionContainer; class. This class Container extends of ArrayObject and instantiates with ARRAY_AS_PROPS flag that means you can easily iterate through properties […]

Zend Framework 2 – Cache Example

In this post, i will show you how to cache your data in ZF2 using “filesystem” adapter.We can directly instance the “ZendCacheStorageAdapter* ” classes or you can implement factory . It’s […]

How to compress html output in zend framework 2 ?

Today’s post is About HTML Output Compression, we can reduce 10-20% load on the server by compressing the HTML output(bandwidth save, faster page loading) we can easily compress the html Output in zend framework […]