Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
July 18, 2014
Tarun Kumar Singhal
Zend Framework 2
Zend Framework 2
Discussion Points
About
Directory Tree Structure
Skeleton Application
Composer
Routing
Session Management...
About

Zend Framework 2 is an open source framework for
developing web applications and services using
PHP 5.3+.

Zend F...
Directory Tree Structure
config/
---autoload/
---*.config.php
data
module
---ModuleName
------config
------language
------...
Application Code-Flow
Zend Framework 2
Zend Framework 2
Skeleton Application
With the help of composer
# curl -sS https://getcomposer.org/installer | php // to get the composer.p...
Composer
Composer is a tool for dependency management in PHP.
It deals with "packages" or libraries, but it manages them o...
Routing
Routing is the act of matching a request
to a given controller.
Routes are stored in the
“module.config.php” file ...
Session Management
Zend Framework 2
The session manager is a class that is responsible for all aspects of session manageme...
CSS Stylesheets and Twitter
Bootstrap
This is provided by default in ZF2 framework skeleton application.
Bootstrap has bec...
Cont...
Generally, the Bootstrap does the following things:
• It provides the CSS reset that is a style sheet defining sty...
Demo
BitBucket Help URL : https://bitbucket.org/dlu/dlutwbootstrap
Download the Twitter-Bootstrap module to use bootstrap ...
Modules Custom Config file
>> Create custom config file at module's config
dir:
<?php
return array(
'report' => array(
'na...
Service Manager
ServiceManager component is an implementation of the Service
Locator pattern.
OR, we can say
A simple appl...
Database Connectivity with one
Database
Zend Framework 2
Database Connectivity with
multiple Database
Zend Framework 2
Thank You
Zend Framework 2
Prochain SlideShare
Chargement dans…5
×

Zend Framework 2

Overview on Zend Framework 2.
It include on Composer, Routing, custom configuration setup, session management, Bootstrap CSS usage etc..

  • Soyez le premier à commenter

Zend Framework 2

  1. 1. July 18, 2014 Tarun Kumar Singhal Zend Framework 2
  2. 2. Zend Framework 2 Discussion Points About Directory Tree Structure Skeleton Application Composer Routing Session Management CSS Styleshet and Twitter Bootstrap Module Custom Config file Service Manager Database Connectivity with one or more
  3. 3. About  Zend Framework 2 is an open source framework for developing web applications and services using PHP 5.3+.  Zend Framework 2 uses 100% object-oriented code and utilises most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures. Zend Framework 2
  4. 4. Directory Tree Structure config/ ---autoload/ ---*.config.php data module ---ModuleName ------config ------language ------src ---------ModuleName ------------Controller ------------Form ------------Model ------view public vendor • The top level of the module contains organisational directories along with the “Module.php” and “autoload_classmap.php” files. • config - for configuration files src - for PHP classes view - for view scripts Zend Framework 2
  5. 5. Application Code-Flow Zend Framework 2
  6. 6. Zend Framework 2
  7. 7. Skeleton Application With the help of composer # curl -sS https://getcomposer.org/installer | php // to get the composer.phar file # php composer.phar create-project -sdev --repository- url="https://packages.zendframework.com" zendframework/skeleton-application path/to/install # php composer.phar update With the help of GIT # Go to https://github.com/zendframework/ZendSkeletonApplication Then click the “Zip” button. This will download the file with a name like ZendSkeletonApplication-master.zip or similar. Zend Framework 2
  8. 8. Composer Composer is a tool for dependency management in PHP. It deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. The problem that Composer solves is this: You have a project that depends on a number of libraries. Some of those libraries depend on other libraries. You declare the things you depend on. Composer finds out which versions of which packages need to be installed, and installs them Zend Framework 2
  9. 9. Routing Routing is the act of matching a request to a given controller. Routes are stored in the “module.config.php” file found in the config directory. In this file you can modify existing routes and add new routes. Zend Framework 2
  10. 10. Session Management Zend Framework 2 The session manager is a class that is responsible for all aspects of session management. It initializes and configures configuration, storage and save handling. Usage: In module Controller class: Use ZendSessionContainer; In Action: $session = new Container('User'); //to set session $session->offsetSet('UserName', 'Demo User'); //get session $session->offsetGet('UserName'); //session exist check $session->offsetExists('UserName'); //destory session $session->offsetUnset('UserName');
  11. 11. CSS Stylesheets and Twitter Bootstrap This is provided by default in ZF2 framework skeleton application. Bootstrap has became a popular CSS framework, allowing to make your web site professionally looking and visually appealing, even if you don’t have advanced designer skills and without the need of creating basic CSS rules (but, of course you can define your own custom CSS rules on top of Bootstrap to customise your site’s appearance). Bootstrap is freely distributed under the Apache License v.2.0. Zend Framework 2
  12. 12. Cont... Generally, the Bootstrap does the following things: • It provides the CSS reset that is a style sheet defining styles for all possible HTML elements. This ensures your web site will look the same way in all web browsers. • It provides the base CSS rules that define style of typography (headings and text), tables, forms, buttons, images and so on. • It defines the grid system. The grid system allows to arrange elements on your web page in a grid-like structure. • It defines useful web interface components like dropdown menus, navigation bars, breadcrumbs, pagination and so on. • It includes the JavaScript extensions that allow to make Bootstrap- provided interface components more interactive. For example, JavaScript is used to animate dropdown menus and display “modal dialogs”. Zend Framework 2
  13. 13. Demo BitBucket Help URL : https://bitbucket.org/dlu/dlutwbootstrap Download the Twitter-Bootstrap module to use bootstrap CSS Module: dlu/DluTwBootstrap via zend studio Zend Framework 2
  14. 14. Modules Custom Config file >> Create custom config file at module's config dir: <?php return array( 'report' => array( 'name' => 'Name' ), );?> >> In Controller's action of Module: <?php $config = $this->getServiceLocator ()->get ( 'config' ); $data = $config['report']; >> Update method of config in module's Module.php to merge the config array Zend Framework 2
  15. 15. Service Manager ServiceManager component is an implementation of the Service Locator pattern. OR, we can say A simple application registry that provides objects (in a lazy loaded fashion) within application as needed – but with some nice additions. Zend Framework 2
  16. 16. Database Connectivity with one Database Zend Framework 2
  17. 17. Database Connectivity with multiple Database Zend Framework 2
  18. 18. Thank You Zend Framework 2

    Soyez le premier à commenter

    Identifiez-vous pour voir les commentaires

  • kstarun

    Aug. 28, 2014

Overview on Zend Framework 2. It include on Composer, Routing, custom configuration setup, session management, Bootstrap CSS usage etc..

Vues

Nombre de vues

1 299

Sur Slideshare

0

À partir des intégrations

0

Nombre d'intégrations

21

Actions

Téléchargements

41

Partages

0

Commentaires

0

Mentions J'aime

1

×