Cover image for Zend Framework 2 Cookbook.
Zend Framework 2 Cookbook.
Title:
Zend Framework 2 Cookbook.
Author:
Callaars, Josephus.
ISBN:
9781849694858
Personal Author:
Physical Description:
1 online resource (368 pages)
Contents:
Zend Framework 2 Cookbook -- Table of Contents -- Zend Framework 2 Cookbook -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. Zend Framework 2 Basics -- Introduction -- Setting up a Zend Framework 2 project -- Getting ready -- How to do it… -- Cloning the skeleton -- Moving the skeleton -- Initializing the Composer -- How it works… -- There's more… -- See also -- Handling routines -- How to do it… -- Setting up routing -- Using SimpleRouteStack -- Using TreeRouteStack -- How it works… -- There's more… -- Namespace - Zend\Mvc\Router\Http -- The Hostname class explained -- The Literal class explained -- Methods explained -- The Part class explained -- Regex explained -- The Scheme class explained -- The Segment class explained -- Understanding dependency injection -- How to do it… -- Initializing the DI at call-time -- Initializing the DI through a Configuration object -- How it works… -- The DI only gives out one instance of an object -- Defining either all properties, or using a Fully Qualified (FQ) setter parameter -- There's more… -- Using configurations to your benefit -- How to do it… -- Creating a global configuration -- Creating configuration that only works for a local machine -- Editing your application.config.php file -- How it works… -- There's more… -- The EventManager and Bootstrap classes -- How to do it… -- Using the bootstrap -- Starting a session -- Using the EventManager class -- Changing the View output -- How it works… -- The Observer pattern explained.

Aspect-Oriented Programming (AOP) explained -- Event-driven architecture explained -- There's more… -- 2. Translating and Mail Handling -- Introduction -- Translating your application -- Getting ready -- How to do it… -- Setting up and checking the essentials -- Translating strings in the controller -- Translating strings in the View -- Translating strings with Poedit -- How it works… -- Basic set up of translation in your module -- There's more… -- PHP array -- Gettext -- Ini -- Localizing your application -- How to do it… -- So it begins -- Localizing currencies -- Localizing date/times -- How it works… -- Identifying the client language -- Localizing currencies and dates -- Sending mail -- How to do it… -- Transport\Sendmail -- Transport\Smtp -- Transport\File -- How it works… -- Sending mail through SMTP -- Sending mail through files -- Receiving mail -- Getting ready -- How to do it… -- Connecting to an IMAP mail server -- Connecting to a POP3 mail server -- Working with flags on IMAP or Maildir connections -- Maildir++ Quota system -- Keeping a connection alive -- How it works… -- Connecting to a POP3 server -- About the Maildir++ Quota system -- Keeping the connection alive -- There's more… -- 3. Handling and Decorating Forms -- Introduction -- Creating forms -- Getting ready… -- How to do it… -- Creating a basic form -- Defining a form that is extended from Zend\Form -- Defining a form that uses the Zend\Form\Annotation -- Adding elements to a Zend\Form extend form -- Adding elements to an annotated form -- Validating form input -- How it works… -- Setting up a basic form -- Setting up an annotated form -- Adding elements to the form -- Forms, filtering, and validation -- There's more… -- Using form view helpers -- How to do it… -- Form -- FormButton -- FormCaptcha -- FormCheckbox -- FormCollection -- FormColor.

FormDate, FormDateTime, and FormDateTimeLocal -- FormEmail -- FormFile -- FormHidden -- FormImage -- FormInput -- FormLabel -- FormElementErrors -- How it works… -- Form -- FormButton -- FormCaptcha -- FormCheckbox -- FormCollection -- FormColor -- FormDate, FormDateTime, and FormDateTimeLocal -- FormEmail -- FormFile -- FormHidden -- FormImage -- FormInput -- FormLabel -- FormElementErrors -- Creating a custom form element and form view helper -- How to do it… -- Creating the new element -- Creating the new view helper -- Adding view helper to the configuration -- Displaying the new element -- How it works… -- Creating the element -- What did we do -- 4. Using View -- Introduction -- Working with View -- Getting ready -- How to do it… -- Configure the ViewManager -- Set variables in the ViewModel instance -- Mark up the template file -- How it works… -- The configuration -- The ViewModel instance -- The ViewStrategy class -- The ViewRenderer helper -- Getting ready -- How to do it… -- The BasePath view helper -- The Doctype view helper -- The URL view helper -- The Partial view helper -- How it works… -- Zend\View\Helper\AbstractHelper -- The BasePath view helper explained -- The Doctype view helper explained -- The URL view helper explained -- The Partial view helper explained -- There's more… -- Creating a global layout template -- Getting ready -- How to do it… -- Creating the main layout file -- Creating the error templates -- How it works… -- Creating reusable Views -- Getting ready -- How to do it… -- Use the Action view helper to get the re-usable content -- Define a child to the ViewModel instance -- How it works… -- The Action view helper explained -- Defining a child to a ViewModel instance explained -- Pros and cons -- Using view strategies/renderers -- Getting ready -- How to do it… -- Adding a view strategy -- The JSON strategy.

The Feed strategy -- How it works… -- The view strategy class -- The default view strategies -- The JSON strategy explained -- The Feed strategy explained -- More about view strategies -- Using context switching for a different output -- Getting ready -- How to do it… -- Define multiple strategies to output -- Determine the view model based on the Accept header -- How it works… -- There's more… -- Writing a custom view strategy/renderer -- How to do it… -- Creating the XmlOutput renderer -- How it works… -- The XmlRenderer and XmlModel -- The XmlStrategy -- There's more… -- 5. Configuring and Using Databases -- Introduction -- Default database engines available -- IBM DB2 driver -- MySQLi driver -- OCI8 driver -- PGSQL driver -- SQLSRV driver -- PDO driver -- Connecting to a database -- Getting ready -- How to do it… -- Connecting to a MySQL database through the configuration -- Connecting to multiple databases through the configuration -- Connecting to a MySQL database through code -- How it works… -- Connecting to a MySQL database through the configuration -- Connecting to multiple databases through the configuration -- About the ServiceManager -- Executing simple queries -- Getting ready -- How to do it… -- Using raw SQL -- Using the prepared statements -- Quote identifier -- Quote identifier chain -- Quote (trusted) value -- Quote value list -- Quote identifier in fragment -- How it works… -- Using raw SQL -- Using prepared statements -- Quoting in our SQL -- Using createStatement -- Executing queries using TableGateway -- Getting ready -- How to do it… -- Inserting a new record -- Updating a record -- Deleting a record -- Advanced selects - joins conditions -- How it works… -- Optimizating with a DB profiler -- Getting ready -- How to do it… -- Setting up a new profiler -- How it works… -- There's more… -- Creating a Database Access Object.

Getting ready -- How to do it… -- Creating our new module and configuration -- Creating a connector -- Creating a mapper interface -- Creating an abstract mapper class -- Creating a Data Transfer Object -- Creating a mapper class -- How it works… -- About the DAO -- About the recipe -- 6. Modules, Models, and Services -- Introduction -- Creating a new module -- Getting ready -- How to do it… -- Creating the Module.php -- Attaching to the loadModules.postevent -- Implementing the getAutoloaderConfig -- Implementing the getControllerConfig, getControllerPluginConfig and getViewHelperConfig -- How it works… -- Creating a new module directory -- Creating the Module.php -- Optionally act on ModuleManager events -- Understanding the loadModules event -- The loadModules.resolve event -- The loadModule event -- The loadModules.post -- Attaching to the loadModules.post event -- More specific non configuration file Module configuration -- The getAutoloaderConfig method -- The getControllerConfig, getControllerPluginConfig, and getViewHelperConfig methods -- Using modules as a widget -- Getting ready -- How to do it… -- Creating the Comment/Controller/Index -- Using a view helper to display the comments statically -- Using the forward to render the comments statically -- Getting the comments through AJAX -- How it works… -- Using a view helper to display the comments statically -- Using the forward() method to render the comments statically -- Getting the comments through AJAX -- About Widgetizing -- A Model and a Hydrator -- Getting ready -- How to do it… -- Accessing the Model -- Creating a Hydrator -- Creating a Hydrator strategy -- How it works… -- Think about the model's purpose -- Think about the model's location -- Think about the model's methods -- Unit test the model -- Document your class -- Creating a hydrator -- Creating a hydrator strategy.

About models.
Abstract:
This book is written in a practical, cookbook style with numerous examples and recipes. This style allows you to go both directly to your topic of interest or follow topics throughout a chapter to gain an in-depth knowledge of certain areas.'Zend Framework 2 Cookbook" is for PHP developers who are fairly advanced in programming in PHP. It will also be useful for developers who have a keen interest in expanding their knowledge outside the boundaries of simply scripting pages together. As unit testing and MVC will be discussed, it is beneficial for the reader to know what these technologies are, although experience with developing applications is not necessarily essential.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: