zend lab
DESCRIPTION
Zend Lab http://leonguyen.comTRANSCRIPT
![Page 2: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/2.jpg)
Features- Purpose: An open source Zend CMS- GUI: Bootstrap + jQuery + Dojo- Technology: Zend 2 + Node.js + NoSQL
![Page 3: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/3.jpg)
Modules- Content: + News, Media (Photo-Video|Infographic-Mindmap), Slide+ Products-Cart, Vote-Survey-Chat, Form+App- Channel: + Web, Tablet, Mobile, Email, SMS, Print
![Page 4: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/4.jpg)
Design- Logo & Icon- Color scheme & Pattern- Typography- Elements
![Page 5: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/5.jpg)
Layout - Responsive
![Page 6: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/6.jpg)
Layout - Metro
![Page 7: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/7.jpg)
Zend Core
![Page 8: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/8.jpg)
Installation- Download Zend Server Community Edition (include Zend Framework 2.0) (http://framework.zend.com/downloads/latest)
![Page 10: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/10.jpg)
Generate a Trial License for Zend Server
- Go to http://www.zend.com/en/products/server/license
![Page 11: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/11.jpg)
Config Zend Application
- Download Zend Skeleton Application (https://github.com/zendframework/ZendSkeletonApplication)
![Page 12: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/12.jpg)
New Environtment Variables
![Page 13: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/13.jpg)
Config Windows Host - Go to: C:\Windows\System32\drivers\etc\hosts
![Page 14: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/14.jpg)
Config Zend Server Host- Go to: C:\Program Files\Zend\ZendServer\etc\sites.d- Make host file: 'vhost_zendcms.com.conf'- Restart Zend Server
![Page 16: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/16.jpg)
Config Zend Module
- Download Zend Skeleton Module (https://github.com/zendframework/ZendSkeletonModule)
![Page 17: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/17.jpg)
Add Skeleton Module- Go to: <Source Path>\zendcms\module- Extract to: 'ZendSkeletonModule'
![Page 18: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/18.jpg)
Config application.config- Go to: <Source Path>\zendcms\config- Edit file: 'application.config.php'
![Page 19: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/19.jpg)
Config module.config- Go to: <Source Path>\zendcms\module\ZendSkeletonModule\config- Edit file: 'module.config.php'
![Page 21: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/21.jpg)
Zend MVC
- Programmer’s Reference Guide of Zend Framework 2: http://framework.zend.com/manual/2.0/en/index.html#zendframeworkreference
![Page 22: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/22.jpg)
MVC Diagram
![Page 23: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/23.jpg)
DAO Design Pattern
![Page 24: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/24.jpg)
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.
![Page 25: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/25.jpg)
Create directories- Creating following directories.
![Page 26: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/26.jpg)
Create Module.php- Create 'Module.php' in the Album module.
![Page 27: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/27.jpg)
Configuration- Create a file 'module.config.php' under <Source Path>\zendcms\module\Album\config
![Page 28: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/28.jpg)
Config application.config- Go to: <Source Path>\zendcms\config- Edit file: 'application.config.php'
![Page 29: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/29.jpg)
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
![Page 30: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/30.jpg)
Add Router- Modify 'module.config.php' under <Source Path>\zendcms\module\Album\config
![Page 31: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/31.jpg)
Create the Controller- Create controller class 'AlbumController.php' under <Source Path>\module\Album\src\Album\Controller
![Page 32: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/32.jpg)
DB Schema- Create SQL statements to create the album table.
![Page 33: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/33.jpg)
Create the Model- Create model class 'Album.php' under <Source Path>\module\Album\src\Album\Model
![Page 34: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/34.jpg)
Create the Model Table- Create model class 'AlbumTable.php' under <Source Path>\module\Album\src\Album\Model
![Page 35: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/35.jpg)
Using ServiceManager to configure the table gateway and inject into the AlbumTable
- Create 'Module.php' in the Album module.
![Page 36: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/36.jpg)
Config DB Driver
- Modify 'global.php' under <Source Path>\config\autoload
![Page 37: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/37.jpg)
Config DB Credentials
- Modify 'local.php' under <Source Path>\config\autoload
![Page 38: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/38.jpg)
Create the View
- Create view 'index.phtml' under <Source Path>\module\Album\view\album\album
![Page 40: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/40.jpg)
Forms and Actions - Add album - Form
- Create view 'AlbumForm.php' under <Source Path>\module\Album\src\Album\Form
![Page 41: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/41.jpg)
Forms and Actions - Add album - Model
- Modify model class 'Album.php' under <Source Path>\module\Album\src\Album\Model
![Page 42: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/42.jpg)
Forms and Actions - Add album - Controller
- Modify controller class 'AlbumController.php' under <Source Path>\module\Album\src\Album\Controller
![Page 43: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/43.jpg)
Forms and Actions - Add album - View
- Create view 'add.phtml' under <Source Path>\module\Album\view\album\album
![Page 44: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/44.jpg)
Forms and Actions - Add album - Open
- Go to: http://zendcms.com/album/add
![Page 45: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/45.jpg)
Forms and Actions - Edit album - Controller
- Modify controller class 'AlbumController.php' under <Source Path>\module\Album\src\Album\Controller
![Page 46: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/46.jpg)
Forms and Actions - Edit album - Model
- Modify model class 'Album.php' under <Source Path>\module\Album\src\Album\Model
![Page 47: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/47.jpg)
Forms and Actions - Edit album - View
- Create view 'edit.phtml' under <Source Path>\module\Album\view\album\album
![Page 48: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/48.jpg)
Forms and Actions - Delete album - Controller
- Modify controller class 'AlbumController.php' under <Source Path>\module\Album\src\Album\Controller
![Page 49: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/49.jpg)
Forms and Actions - Edit album - View
- Create view 'delete.phtml' under <Source Path>\module\Album\view\album\album
![Page 50: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/50.jpg)
Zend Authentication
![Page 51: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/51.jpg)
Zfc [Base.User.Acl]
- Download (https://github.com/ZF-Commons/ZfcUser)(https://github.com/ZF-Commons/ZfcBase)(https://github.com/bjyoungblood/BjyAuthorize)
![Page 52: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/52.jpg)
Add ZfcBase, ZfcUser, BjyAuthorize- Go to: <Source Path>\zendcms\vendor- Extract to: 'ZfcUser', 'ZfcBase', 'BjyAuthorize'
![Page 53: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/53.jpg)
Config application.config- Go to: <Source Path>\zendcms\config- Edit file: 'application.config.php'
![Page 54: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/54.jpg)
Make database.local- Go to: <Source Path>\zendcms\config\autoload- Create file: 'database.local.php'
![Page 56: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/56.jpg)
DB ListStar:1) User (u)2) Tag (t): Page, Menu, Category3) Post (p): Article, Products, Banner4) Meta (m): Media5) Option (o): Configuration
![Page 57: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/57.jpg)
Table List1) u: uId, uName, uPass, uEmail, uDesc2) t: tId, tName, tDesc3) p: pId, uId, pTitle, pContent4) m: mId, pId, mKey, mValue5) o: oId, oKey, oValue
![Page 58: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/58.jpg)
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
![Page 59: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/59.jpg)
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
![Page 60: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/60.jpg)
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
![Page 61: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/61.jpg)
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
![Page 62: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/62.jpg)
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
![Page 63: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/63.jpg)
Login
![Page 64: Zend Lab](https://reader035.vdocuments.us/reader035/viewer/2022081422/5557d5efd8b42af2178b4d95/html5/thumbnails/64.jpg)
Back-endI) User Manager (Permission)II) Tag Manager (Grid hierachy)III) Layout Manager (Row added elements)Star: 1) Header, 2) Content, 3) Footer, 4) Top, 5) BottomIV) Media ManagerV) Option ManagerPyramid: Navigation (Circle -> Menu) -> Datatable (Search-Filter,Action,Grid-Edit) -> Form (Main Input,Desc Grid) + Custom