Zend Framework 2 : Using Zend\Cache and HydratingResultSet to Save Database Resultset into Cache
Re-load data from the database every web was accessed is not good for your server ‘health’. Zend Framework has a component named Hydrator. The Hydrator is a simple component to provide mechanisms both for hydrating objects, as well as extracting data sets from them.
To save database ResultSet into cache, You need to use Zend\Db\ResultSet\HydratingResultSet which can extract the resultSet into associative array. In this post, i will show you how to cache your database resultset into filesystem.
Zend Framework 2 : Using Logger to Save Error Exception
As developer, we should code as right as possible, but we must be aware that we can’t free from mistake. As long as web is accessed, we need to save the error that we not know-ing, and in next time, we resolve the problem. While using Zend Framework, you can use Logger component to ‘save’ your mistake(s) into file. In this post, i will show you the how to.
We need ZF2 Component named \Zend\Log which use two class : \Zend\Log\Logger and \Zend\Log\Writer\Stream. We need dispatch.error event too.
Continue Reading
Zend Framework 2 : Create Custom Error Page
In production Application Environment, we should handle error page that user will be viewed. In Zend Framework 2, we can create our custom error page which show the user that the page is error, but not show them the exception.
Zend Framework 2 : Using Captcha Image in Zend\Form
Zend Framework provide a component named Zend\Captcha\Image that can be integrated with Zend\Form. It’s very fast to create a captcha image, and put to our form application. I will give an example to you how to work with it.
Zend Framework 2 : Step by Step Create Console Application
Sometimes, console is more interactive than GUI, and quicker to be executed. Console Application often need by cron job or generator for your datawarehouse that summarize your transactional data. It’s very easy in Zend Framework 2.
Just define console route, register controller invokables, set help for command line ( if necessary ), and run it.
25 comments