Home Page Icon
Home Page
Table of Contents for
Zend Framework 2 Application Development
Close
Zend Framework 2 Application Development
by Christopher Valles
Zend Framework 2 Application Development
Zend Framework 2 Application Development
Table of Contents
Zend Framework 2 Application Development
Credits
About the Author
Acknowledgments
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. Let's Build a Social Network
Why ZF2?
What are we going to build?
Building a user profile
Posting text
Uploading pictures
Sharing links
Posting comments
Building news reader
Registering and logging in
E-mails
Public APIs
The approach – API-centric app
Summary
2. Setting Up the Environment
Using the provided virtual machine
Installing the required software
Getting a copy of the files
Vagrantfile
VirtualBox subnet
ZF2 skeleton
Hosts file
Vagrant commands
Summary
3. Scratching the Surface of Zend Framework 2
Bootstrap your app
Configuration array
PSR-0 and autoloaders
ServiceManager
EventManager
ModuleManager
Request object
Response object
The request object
The router
SimpleRouteStack
TreeRouteStack
Hostname
Literal
Method
Part
Regex
Scheme
Segment
Wildcard
Query
DispatchListener
Front controller
InjectApplicationEvent
ServiceLocatorAware
EventManagerAware
Controller plugins
Controller types
AbstractActionController
AbstractRestfulController
The response object
An example is worth a thousand words
The config folder
Language files
Module.php
Src folder
View folder
Summary
4. The First Request/Response – Building the User Wall
API development
Requirements
Working with the database
ZendDbAdapter
ZendDbTableGateway
ZendDbRowGateway
Setting up the connection
ViewManager configuration
Creating the Users module
Creating the UsersTable.php file
Module configuration
The module.php file
Adding the Wall module
Module.php contents
Module configuration
Adding the IndexController.php file
The API-Error approach
Adding the Common module
Modifying the application.config.php file
Modifying the Module.php file
Modifying the module.config.php file
Adding the ApiErrorListener.php file
Frontend
Adding the Users module
Contents of the Module.php file
Creating the User.php file
Requesting the wall content
Modifying the Module.php file
Module configuration
Changes in the IndexController.php file
Outputting the user wall
Summary
5. Handling Text Content – Posting Text
API development
Requirements
Working with the database
Understanding the module structure
Creating UserStatusesTable.php
Extending IndexController.php
Modifying module.config.php
Frontend
Creating Status.php
Modifying User.php
View
TextStatusForm.php
text-content-form.html
Modifying IndexController.php
Extending ApiClient.php
Summary
6. Working with Images – Publishing Pictures
API development
Requirements
Working with the database
Changes on the module structure
Creating the UserImagesTable.php file
Extending the IndexController.php file
Changing the module.config.php file
Frontend
Creating the Image.php file
Adding the ImageForm.php file
Showing the form in the image-content-form.phtml file
Extending the User.php file
Modifying the index.phtml file
Modifying the IndexController.php file
Modifying the layout.phtml file
Summary
7. Dealing with URLs – Posting Links
API development
Requirements
Working with the database
Changes in the module structure
Adding the UserLinksTable.php file
Modifying the IndexController.php file
Creating the Url.php file
Modifying the module.config.php file
Frontend
Creating the link entity
Adding the LinkForm.php file
Creating the image-content-form.phtml file
Extending the index.phtml file
Changing the User.php file
Modifying the IndexController.php file
Summary
8. Dealing with Spam – Akismet to the Rescue
API development
Requirements
Working with the database
Module structure
Installing Akismet service
Modifying the local.php file
Adding the UserCommentsTable.php file
Creating the Spam.php file
Extending the IndexController.php file
Table gateways
Frontend
Adding the Comment.php file
Adapting the Status.php file
Modifying the Image.php and Link.php file
Adding the CommentForm.php file
Adding the comment-content-form.phtml file
Modifying the IndexController.php file
Extending the index.phtml file
Summary
9. Let's Read Feeds – A News Reader
Overview
API development
Requirements
Working with the database
Expanding the module structure
The module.config.php file
The Module.php file
Adding the UserFeedsTable.php file
Adding the UserFeedArticleTable.php file
The contents of the IndexController.php file
Creating the CliController.php file
The ApiErrorListener.php file
Frontend
The API module
Modifying the ApiClient.php file
The Feeds module
The contents of module.config.php
The IndexController.php file
Entities and forms
The menu-feed-container.phtml file
The index.phtml file
The Common module
The global.php file
The layout.phtml file
Summary
10. Sign Up
Overview
API development
Requirements
Working with the database
The module structure
Extending UsersTable.php
The IndexController.php file
Frontend
The signup.phtml file
The SignupForm.php file
The signup-form.phtml file
User.php
The contents of the IndexController.php file
The index.phtml file
Changes in the ApiClient.php file
Summary
11. Log in
Overview
API development
Requirements
Overview of the module structure
The module.config.php file
Creating the LoginController.php file
Frontend
The login form
Changes in the ApiClient.php file
Creating a new authentication adapter
The IndexController.php file
The login.phtml file
Changes in module.config.php
The global.php file
The layout.phtml file
ACLs
Modules
The index.phtml file
Wall IndexController.php
Summary
12. Sending E-mails
Overview
API development
Requirements
The module structure
Adding the mailer.php file
The email-layout.phtml file
The view welcome.php file
The view new-comment.phtml file
Modifying the IndexController.php file
The IndexController.php file on the Wall module
The challenge
Summary
13. OAuth 2.0 Protocol Securing our API
Overview
API development
The module structure
Installing the OAuth 2.0 component
Modifying LoginController.php
Adding OAuthListener.php to the Common module
Other changes in the Common module
Frontend
Modifying ApiClient.php
Modifying Api.php
Following the OAuth 2.0 flow
The challenge
Summary
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Table of Contents
Next
Next Chapter
Zend Framework 2 Application Development
Zend Framework 2 Application Development
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset