Tag Archives: programming

Zend Framework 2 : Mail

Step 1 : Create a new module ZF2Mail to manage mails in Zend Framework 2 Step 2 : In /path/to/yourapp/vendor/ZF2Mail/config/module.config.php

Step 3 : In /path/to/yourapp/vendor/ZF2Mail/src/ZF2Mail/Mail.php

Step 4 : In /path/to/yourapp/vendor/ZF2Mail/Module.php

Step 5 : In /path/to/yourapp/vendor/ZF2Mail/view/emails/templates/

Click here to download the module : Download

API: Add google ads on your website

Zend Framework 2 : Add flash messages

Step 1: module/Application/src/Application/Controller/IndexController.php

Step 2 : module/Application/view/layout/partial/flash-messages.phtml

Step 3 : module/Application/config/module.comfig.php

Step 4 : module/Application/view/application/index/index.phtml

Step 5 : public/css/Style.css

Zend Framework 2 : Manage Exceptions and Error Page

Step 1 : Please create folder “logs” : go/to/yourapp/data/ and give write permission Step 2 : Visit go/to/yourapp/module/Applcation/Module.php Attach event “MvcEvent::EVENT_DISPATCH_ERROR”

Step 3: get Zend Logger instance

Step 4 : Redirect to error page on catching any error

–>

Zend Freamework 2 : beforeDispatch and afterDispatch functions

path/to/yourapp/module/Application/Module.php

Perform action before any controller action called :

Perform action after any controller action called :

bforeDispatch() function :

afterDispatch() function :

Start with Zend Framework 2

Step 1 : Go to https://github.com/zendframework/ZendSkeletonApplication and download sample application in Zip format. Unzip this zip file into the directory where you keep all your applications

Step 2 : Download the latest ZF2 library from http://framework.zend.com/downloads/latest After download, unzip the zip file and place the ZF2 library folder in “vendors” folder.

Alternative solution… Read More »