Beside AbstractActionController, ZF2 has AbstractRestfulController that provide RESTful implementation that simply maps HTTP request methods to controller methods : GET maps to either get() or getList(), POST maps to create(), PUT maps to update(), and DELETE maps to delete().
Authentication is the process of verifying that “you are who you say you are”. Zend Framework 2 has an AuthenticationService component that usefull to handle this. It can use Adapters, like DbTable, Digest, Http, and Ldap with Session Storage that can be save until time we need by rememberMe() function from Session Manager.
Sometime, we need to grab web content for our application, and then, get the content of selection element ( by tagname for example ). We need DOMElement nodeValue by atributeNode and its textContent. Zend Framework has components that utilize this needed. The components are Zend\Http and Zend\Dom.
Zend Framework 2 Validator classes provide a setTranslator() method with which you can specify an instance of Zend\I18n\Translator\Translator which will translate the messages in case of a validation failure. The getTranslator() method returns the set translator instance. This is very easy in Zend Framework 2.
You have bored with nested array configuration ? Zend Framework 2 give us not only one choice to setting up module config, not only array, we can use another way : XML, ini, Yaml. I will show you how to use xml file be a config of your module.
Zend Framework provide AnnotationBuilder that can createForm by entity which we defined. An entity can be one class that consists of Annotation Type, Filter, Validator, etc in each of the properties. This feature need doctrine Annotation. In this post, i will give you step by step how to use this annotation .
Zend Framework 2 : Extending Zend\Form to add Select, Multicheckbox, Email,Date, Textarea, and Radio element
By extending Zend\Form, we can add elements into form on the fly instead of manually instantiate the element(s).
For example, we want a form like this :
I will show you the way to do that. In Zend Framework 2, it’s very easy.