Slide 1

Slide 1 text

Zend Lab leonguyen.com

Slide 2

Slide 2 text

Features - Purpose: An open source Zend CMS - GUI: Bootstrap + jQuery + Dojo - Technology: Zend 2 + Node.js + NoSQL

Slide 3

Slide 3 text

Modules - Content: + News, Media (Photo-Video|Infographic-Mindmap), Slide + Products-Cart, Vote-Survey-Chat, Form+App - Channel: + Web, Tablet, Mobile, Email, SMS, Print

Slide 4

Slide 4 text

Design - Logo & Icon - Color scheme & Pattern - Typography - Elements

Slide 5

Slide 5 text

Layout - Responsive

Slide 6

Slide 6 text

Layout - Metro

Slide 7

Slide 7 text

Zend Core

Slide 8

Slide 8 text

Installation - Download Zend Server Community Edition (include Zend Framework 2.0) (http://framework.zend.com/downloads/latest)

Slide 9

Slide 9 text

Start Zend Server - Go to http://localhost:10081/ZendServer

Slide 10

Slide 10 text

Generate a Trial License for Zend Server - Go to http://www.zend.com/en/products/server/license

Slide 11

Slide 11 text

Config Zend Application - Download Zend Skeleton Application (https://github. com/zendframework/ZendSkeletonApplication)

Slide 12

Slide 12 text

New Environtment Variables

Slide 13

Slide 13 text

Config Windows Host - Go to: C:\Windows\System32\drivers\etc\hosts

Slide 14

Slide 14 text

Config Zend Server Host - Go to: C:\Program Files\Zend\ZendServer\etc\sites.d - Make host file: 'vhost_zendcms.com.conf' - Restart Zend Server

Slide 15

Slide 15 text

Start ZF2 Skeleton Application - Go to: http://zendcms.com

Slide 16

Slide 16 text

Config Zend Module - Download Zend Skeleton Module (https://github. com/zendframework/ZendSkeletonModule)

Slide 17

Slide 17 text

Add Skeleton Module - Go to: \zendcms\module - Extract to: 'ZendSkeletonModule'

Slide 18

Slide 18 text

Config application.config - Go to: \zendcms\config - Edit file: 'application.config.php'

Slide 19

Slide 19 text

Config module.config - Go to: \zendcms\module\ZendSkeletonModule\config - Edit file: 'module.config.php'

Slide 20

Slide 20 text

Start Skeleton Module - Go to: http://zendcms.com/skeleton

Slide 21

Slide 21 text

Zend MVC - Programmer’s Reference Guide of Zend Framework 2: http://framework.zend.com/manual/2. 0/en/index.html#zendframeworkreference

Slide 22

Slide 22 text

MVC Diagram

Slide 23

Slide 23 text

DAO Design Pattern

Slide 24

Slide 24 text

Describe Album Module - The application that we are going to build is a simple inventory system to display which albums we own. The main page will list our collection and allow us to add, edit and delete CDs. Page Description List of albums This will display the list of albums and provide links to edit and delete them. Also, a link to enable adding new albums will be provided. Add new album This page will provide a form for adding a new album. Edit album This page will provide a form for editing an album. Delete album This page will confirm that we want to delete an album and then delete it.

Slide 25

Slide 25 text

Create directories - Creating following directories.

Slide 26

Slide 26 text

Create Module.php - Create 'Module.php' in the Album module.

Slide 27

Slide 27 text

Configuration - Create a file 'module.config.php' under \zendcms\module\Album\config

Slide 28

Slide 28 text

Config application.config - Go to: \zendcms\config - Edit file: 'application.config.php'

Slide 29

Slide 29 text

Routing and controllers - As we have four pages that all apply to albums, we will group them in a single controller AlbumController within our Album module as four actions Page Controller Action Home AlbumController index Add new album AlbumController add Edit album AlbumController edit Delete album AlbumController delete

Slide 30

Slide 30 text

Add Router - Modify 'module. config.php' under \zendcms\modul e\Album\config

Slide 31

Slide 31 text

Create the Controller - Create controller class 'AlbumController.php' under \module\Album\src\Album\Controller

Slide 32

Slide 32 text

DB Schema - Create SQL statements to create the album table.

Slide 33

Slide 33 text

Create the Model - Create model class 'Album.php' under \module\Album\src\Album\Model

Slide 34

Slide 34 text

Create the Model Table - Create model class 'AlbumTable.php' under \module\Album\src\Albu m\Model

Slide 35

Slide 35 text

Using ServiceManager to configure the table gateway and inject into the AlbumTable - Create 'Module.php' in the Album module.

Slide 36

Slide 36 text

Config DB Driver - Modify 'global.php' under \config\autoload

Slide 37

Slide 37 text

Config DB Credentials - Modify 'local.php' under \config\autoload

Slide 38

Slide 38 text

Create the View - Create view 'index.phtml' under \module\Album\view\album\album

Slide 39

Slide 39 text

Open Album - Go to: http://zendcms.com/album

Slide 40

Slide 40 text

Forms and Actions - Add album - Form - Create view 'AlbumForm.php' under \module\Album\src\Album\Form

Slide 41

Slide 41 text

Forms and Actions - Add album - Model - Modify model class 'Album.php' under \module\Album\src\Album\M odel

Slide 42

Slide 42 text

Forms and Actions - Add album - Controller - Modify controller class 'AlbumController.php' under \module\Album\src\Album\Controller

Slide 43

Slide 43 text

Forms and Actions - Add album - View - Create view 'add.phtml' under \module\Album\view\album\album

Slide 44

Slide 44 text

Forms and Actions - Add album - Open - Go to: http://zendcms.com/album/add

Slide 45

Slide 45 text

Forms and Actions - Edit album - Controller - Modify controller class 'AlbumController.php' under \module\Album\src\Album\C ontroller

Slide 46

Slide 46 text

Forms and Actions - Edit album - Model - Modify model class 'Album.php' under \module\Album\src\Album\Model

Slide 47

Slide 47 text

Forms and Actions - Edit album - View - Create view 'edit.phtml' under \module\Album\view\album\album

Slide 48

Slide 48 text

Forms and Actions - Delete album - Controller - Modify controller class 'AlbumController.php' under \module\Album\src\Album\C ontroller

Slide 49

Slide 49 text

Forms and Actions - Edit album - View - Create view 'delete.phtml' under \module\Album\view\album\album

Slide 50

Slide 50 text

Zend Authentication

Slide 51

Slide 51 text

Zfc [Base.User.Acl] - Download (https://github.com/ZF-Commons/ZfcUser) (https://github.com/ZF-Commons/ZfcBase) (https://github.com/bjyoungblood/BjyAuthorize)

Slide 52

Slide 52 text

Add ZfcBase, ZfcUser, BjyAuthorize - Go to: \zendcms\vendor - Extract to: 'ZfcUser', 'ZfcBase', 'BjyAuthorize'

Slide 53

Slide 53 text

Config application.config - Go to: \zendcms\config - Edit file: 'application.config.php'

Slide 54

Slide 54 text

Make database.local - Go to: \zendcms\config\autoload - Create file: 'database.local.php'

Slide 55

Slide 55 text

Start url User - Go to: http://zendcms.com/user/login

Slide 56

Slide 56 text

DB List Star: 1) User (u) 2) Tag (t): Page, Menu, Category 3) Post (p): Article, Products, Banner 4) Meta (m): Media 5) Option (o): Configuration

Slide 57

Slide 57 text

Table List 1) u: uId, uName, uPass, uEmail, uDesc 2) t: tId, tName, tDesc 3) p: pId, uId, pTitle, pContent 4) m: mId, pId, mKey, mValue 5) o: oId, oKey, oValue

Slide 58

Slide 58 text

1) User (u) CREATE TABLE `user` ( `uId` INT NOT NULL AUTO_INCREMENT , `uName` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `uPass` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `uEmail` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `uDesc` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY ( `uId` ) ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

Slide 59

Slide 59 text

2) Tag (t) CREATE TABLE `tag` ( `tId` INT NOT NULL AUTO_INCREMENT , `tName` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `tDesc` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY ( `tId` ) ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

Slide 60

Slide 60 text

3) Post (p) CREATE TABLE `post` ( `pId` INT NOT NULL AUTO_INCREMENT , `uId` INT NOT NULL , `pTitle` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `pContent` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY ( `pId` ) ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

Slide 61

Slide 61 text

4) Meta (m) CREATE TABLE `meta` ( `mId` INT NOT NULL AUTO_INCREMENT , `pId` INT NOT NULL , `mKey` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `mValue` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , PRIMARY KEY ( `mId` ) ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

Slide 62

Slide 62 text

5) Option (o) CREATE TABLE `option` ( `oId` INT NOT NULL AUTO_INCREMENT , `oKey` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `oValue` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , PRIMARY KEY ( `oId` ) ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

Slide 63

Slide 63 text

Login

Slide 64

Slide 64 text

Back-end I) User Manager (Permission) II) Tag Manager (Grid hierachy) III) Layout Manager (Row added elements) Star: 1) Header, 2) Content, 3) Footer, 4) Top, 5) Bottom IV) Media Manager V) Option Manager Pyramid: Navigation (Circle -> Menu) -> Datatable (Search-Filter, Action,Grid-Edit) -> Form (Main Input,Desc Grid) + Custom

Slide 65

Slide 65 text

Github - Go to: https://github.com/leonguyen/zendcms