SlideShare una empresa de Scribd logo
1 de 18
July 18, 2014
Tarun Kumar Singhal
Zend Framework 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
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
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
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.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
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
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
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');
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
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
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
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
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
Database Connectivity with one
Database
Zend Framework 2
Database Connectivity with
multiple Database
Zend Framework 2
Thank You
Zend Framework 2

Más contenido relacionado

La actualidad más candente

Zend Framework 2 Components
Zend Framework 2 ComponentsZend Framework 2 Components
Zend Framework 2 ComponentsShawn Stratton
 
Get Started with Zend Framework 2
Get Started with Zend Framework 2Get Started with Zend Framework 2
Get Started with Zend Framework 2Mindfire Solutions
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Stefano Valle
 
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)ZFConf Conference
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf Conference
 
Cryptography with Zend Framework
Cryptography with Zend FrameworkCryptography with Zend Framework
Cryptography with Zend FrameworkEnrico Zimuel
 
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Fwdays
 
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf Conference
 
WordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with VulneroWordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with VulneroAndrew Kandels
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryBo-Yi Wu
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 
Using Zend_Tool to Establish Your Project's Skeleton
Using Zend_Tool to Establish Your Project's SkeletonUsing Zend_Tool to Establish Your Project's Skeleton
Using Zend_Tool to Establish Your Project's SkeletonJeremy Brown
 
How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11Stephan Hochdörfer
 
Modular architecture today
Modular architecture todayModular architecture today
Modular architecture todaypragkirk
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
 

La actualidad más candente (20)

Zend Framework 2 Components
Zend Framework 2 ComponentsZend Framework 2 Components
Zend Framework 2 Components
 
Get Started with Zend Framework 2
Get Started with Zend Framework 2Get Started with Zend Framework 2
Get Started with Zend Framework 2
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2
 
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
 
Cryptography with Zend Framework
Cryptography with Zend FrameworkCryptography with Zend Framework
Cryptography with Zend Framework
 
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
 
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
 
WordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with VulneroWordPress and Zend Framework Integration with Vulnero
WordPress and Zend Framework Integration with Vulnero
 
Zf2 phpquebec
Zf2 phpquebecZf2 phpquebec
Zf2 phpquebec
 
Zend Framework 2 Patterns
Zend Framework 2 PatternsZend Framework 2 Patterns
Zend Framework 2 Patterns
 
2007 Zend Con Mvc Edited Irmantas
2007 Zend Con Mvc Edited Irmantas2007 Zend Con Mvc Edited Irmantas
2007 Zend Con Mvc Edited Irmantas
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular Library
 
Extending Zend_Tool
Extending Zend_ToolExtending Zend_Tool
Extending Zend_Tool
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
Using Zend_Tool to Establish Your Project's Skeleton
Using Zend_Tool to Establish Your Project's SkeletonUsing Zend_Tool to Establish Your Project's Skeleton
Using Zend_Tool to Establish Your Project's Skeleton
 
How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11
 
Modular architecture today
Modular architecture todayModular architecture today
Modular architecture today
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
RequireJS
RequireJSRequireJS
RequireJS
 

Similar a Zend Framework 2

OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015Oro Inc.
 
JavaScript Modules in Practice
JavaScript Modules in PracticeJavaScript Modules in Practice
JavaScript Modules in PracticeMaghdebura
 
Magento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentMagento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentIvan Chepurnyi
 
Edp bootstrapping a-software_company
Edp bootstrapping a-software_companyEdp bootstrapping a-software_company
Edp bootstrapping a-software_companyGanesh Kulkarni
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedClaudio Procida
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughBradley Holt
 
Yii in action
Yii in actionYii in action
Yii in actionKeaNy Chu
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET Journal
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015David Alger
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Foundations of Zend Framework
Foundations of Zend FrameworkFoundations of Zend Framework
Foundations of Zend FrameworkAdam Culp
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentKapil Dev Singh
 
Architecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolArchitecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolAdriaan Venter
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introductionCommit University
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..webhostingguy
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..webhostingguy
 

Similar a Zend Framework 2 (20)

OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
 
Php myadmin
Php myadminPhp myadmin
Php myadmin
 
JavaScript Modules in Practice
JavaScript Modules in PracticeJavaScript Modules in Practice
JavaScript Modules in Practice
 
Magento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentMagento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module development
 
Edp bootstrapping a-software_company
Edp bootstrapping a-software_companyEdp bootstrapping a-software_company
Edp bootstrapping a-software_company
 
Zend
ZendZend
Zend
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start Walkthrough
 
Yii in action
Yii in actionYii in action
Yii in action
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Foundations of Zend Framework
Foundations of Zend FrameworkFoundations of Zend Framework
Foundations of Zend Framework
 
TomatoCMS in A Nutshell
TomatoCMS in A NutshellTomatoCMS in A Nutshell
TomatoCMS in A Nutshell
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
 
Architecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling ToolArchitecture Specification - Visual Modeling Tool
Architecture Specification - Visual Modeling Tool
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introduction
 
Struts
StrutsStruts
Struts
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..
 
apresentacao_apache2..
apresentacao_apache2..apresentacao_apache2..
apresentacao_apache2..
 

Último

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 

Último (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Zend Framework 2

  • 1. July 18, 2014 Tarun Kumar Singhal Zend Framework 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. 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. 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
  • 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. 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. 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. 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. 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. 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. 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. 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. 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. Database Connectivity with one Database Zend Framework 2
  • 17. Database Connectivity with multiple Database Zend Framework 2