PHP102 for the R

fishhookFladgeInternet και Εφαρμογές Web

13 Δεκ 2013 (πριν από 3 χρόνια και 5 μήνες)

74 εμφανίσεις

PHP102 for the
R
Mike
P
Solutions
Zend Tech
n
Week Six–Mor
e
R
PG Programme
r
P
avlak
Consultant
n
ologies, Inc.
e
PHP OOP & ZF
Sur
v

How has this class i
m

Helped a lot

Helped a little
Nthhl

N
o
t
muc
h

h
e
l
p

Hated the class

Get a real job, Mike!
v
ey
m
pacted your PHP?
This is the

SystemiNetwork will se

Watch for more PHP cl

Some GREAT articles
b
Maybeotherinstructors

Maybe

other

instructors
last week!
nd out a survey to all
asses
b
y Jon Paris
s
s

Review poi
n

PHP development pat
h

Object Oriented Model

Classes
Objects

Objects
z
Properties

Methods
n
ts from last
h
Introduction
This
w

Finish up OOP

Customer example

A few tips

Zend Framework

Update process

Hello World, again!
w
eek!
Wrap
u
u
p OOP
Custom
e

Review the code

Explore the architectur
e

Explore the three meth

Show output
e
r Class
e
of the application
ods
Example
A

Form to accept the val

PHP102W6Ex1f1.php

Class definition file

PHP102W6Ex1Class.
p
Otptscripttocontro

O
u
tp
u
t

script

to

contro

PHP102W6Ex1Out.ph
p
A
rchitecture
ues input by use
r
p
hp
ldispla
l

displa
y
p
Form
Input
PHP Cod
e
e
Output
Class Definiti
o
o
n, Method 1
Class Definiti
o
o
n, Method 2
Class Definiti
o
o
n, Method 3
Advantages o
f

Modular code constru
c

Separate HTML from
B

Modify small compon
e

Easy to modify & enh
a

The way everyone is
d

Keep classes close to

If you add a field, add
a
f
Having Class
c
tion
B
usiness Logic
e
nts not large code files
a
nce
d
oing it these days
data representation
a
method…
Zend Fr
a
•What is it
•Why use it
•Short example
a
mework
What is a
f
•Methodology
•System for consistentl
•Most ERP’s have a fr
a
•CGI-Dev2 is a frame
w
•Keyword: re-usable
A
software framework i
s
for a software system (
o
Wikipedia says…
f
ramework
y building applications
a
mework
w
ork, of sorts
s
a re-usable design
o
r subsystem)
Why use a
f
•Consistency
•Simplify/eliminate rep
e
•Database abstraction
•Leverage the develop
•Is RPG in itself a fram
e
f
ramework?
e
titive development
once, include many
e
work?
Problem with
•Many developers crea
•New company, new fr
a
•Getting repetitive
•No cross framework k
n
•Had to learn a new m
e
company
•No documentation
frameworks
te frameworks in house
a
mework
n
owledge
e
thodology with each
History of Zen
•ZendCon 1 –Principl
e
•July 2005 –Coding b
e
•Zend’s PHP collabora
t
•Zend Framework
•DevZone
•Eclipse based IDE
•March 2006 –First Pu
•July 2007 –Version 1
.
•Note: Zend does not “
o
d Framework
e
s of PHP said ENOUGH!
e
gins
t
ion project:
blic release
.
0 released
o
wn” Zend Framework
Why Zend
F
•Best practices
•Open source
•Developed by the com
m
•Free BSD style licens
e
•Contributors sign CLA
•Extensionability
•Simplicity
•Consistency across a
p
F
ramework
m
unity-for the community
e
, no liability or copyright
p
plications and shops
Why use Zen
d
•MVC is in full force
•Use-at-will architectur
e

A
ggressive developm
e
•Great example of how
d
Framework?
e
e
nt plan
to use OOP in PHP
Install
•With Zend Core
•But newer version
available at
•http://www.zendframe
k/dld/l
wor
k
.com
/d
own
l
oa
d/l
a
test
•See my new devzone
article, coming soon!
ation
ZF install
a
•Unzip to directory
•/usr/local/zend/ZendFra
m
•It is really up to you…
Udthiiild

U
p
d
a
t
e p
h
p.
i
n
i

i
nc
l
u
d
e
p
•Restart Apache
a
tion cont.
m
ework
thiZdCAdi
p
a
th

i
n
Z
en
d

C
ore
Ad
m
i
n
Te
s
s
t it
Look at
f
•Protect against XSS,
S
•ZF has built in compo
n
f
iltering
S
QL Injection, etc.
n
ents to protect.
Real worl
d
d
filtering
Filter H
T
T
ML…
The continuing
Education Path
Su
g
The Educa
t
RPG Developer
1.HTML
4. Learn
Oriented
2. Introduction to
PHP
1.

HTML

3. Procedural
Project
(soak time)
Oriented
5. Object
O
Proj
e
(
Soak
t
6. Whe
n
Expl
o
Frame
g
gested…
t
ional Path
Object
dPHP
Zend
Zend Studio for
Eclipse
7. Framework
Project
JavaScript & AJAX
d

PHP
O
riented
e
ct
t
ime
)
n
read
y
o
re
wor
k
Project
(Soak time)
PHP Developer
Refer
e
PHP 5 In Practic
e
ISBN: 06723288
8
Php|architect’sGuide to Progra
m
with Zend Framework –Cal Ev
a
ISBN: 0973862157
e
nces
e
–Eli White
8
7
m
ming
a
ns
Homework fo
r

None! Thank you for
r
next week...
joining the class!
Have a great H
o
•Contact me at mike.p
@
o
liday Season!
@
zend.com