Presentation is loading. Please wait.

Presentation is loading. Please wait.

Overview of Framework by Ahamed Rifaudeen A. page - i Steps before entering into the Framework?  Basic knowledge of object-oriented programming (OOP)

Similar presentations


Presentation on theme: "Overview of Framework by Ahamed Rifaudeen A. page - i Steps before entering into the Framework?  Basic knowledge of object-oriented programming (OOP)"— Presentation transcript:

1 Overview of Framework by Ahamed Rifaudeen A

2 page - i Steps before entering into the Framework?  Basic knowledge of object-oriented programming (OOP) in php5  Database programming (Mysql, Sqlite3)  These are things that makes you the better understanding the frameworks easily. Required Knowledge?

3 page - ii Cms Vs Framework  Cms (Content-Management-System) is a type of Framework,  But generally limited towards making website with article/page type content with an out of the box article management system.  Mostly of the cms are focused on article management system. Cms  A Framework provides often used web development boilerplate code.  They can... MVC paradigm URL parsing and handling Templating Better request handling Framework

4 page - 1 What is Framework?  A set of reusable libraries or classes for a software is generally called as Frameworks  Model-View-Controller (MVC)  Push-based vs. pull-based  Three-tier organization Definition: Types of Framework:

5 page - 2 Model-View-Controller (MVC)  Consist of any business logics  Ex: database connection, user authentication, and etc.., Model: View:  Consist of site layouts, and designs  Ex: html files  Controls the model and view  Decides Which model needed and which content is to be shown Controller:

6 page - 3 Yii Framework Yii is a high-performance light weight framework Yii Stand for – Yes It Is Yii Framework is a Open Source Framework Download @ www.yiiframework.com Yii Framework implements MVC Architecture Version 1.1.13 is the current stable version Yii introduces a front controller called Application Application collects information about a user request and dispatch it to an appropriate controller

7 page - 4 Installing and Configuring Yii  Extract Downloaded Zip file into your server root  Ex: Save @ C:\wamp\www\ Installing Yii Framework Configuring Yii Framework  Set environment variables  Append php path (C:\wamp\bin\php\php5.2.6) with path in the Environment Variables

8 page - 5 Creating a new application  Change directory to your framework root With Command Prompt

9 page - 6 Contd..  Type yiic

10 page - 7 Contd..  Ex: yiic webapp C:\wamp\www\demoProject Syntax: yiic webapp path/to/demoProject Testing our demoProject  Locate the browser wih http://localhost/demoProject/http://localhost/demoProject/  Our project available with four menu

11 page - 8 Structure of Yii Application  Index.php the bootstrap file  Application the front controller  App components used by our application  Controller controlling model and views  Model contains business logics, database and other inputs collected through forms  View contains user interface  Widget probably embeded in view files mainly for presentational purpose

12 page - 9 Application workflow 1.User requests http://www.webrobo.in/index.php?r=post/sho w&id=1 http://www.webrobo.in/index.php?r=post/sho w&id=1 2.Application object created. 3.Application gets information about request. 4.Application determines the requested controller and action. 5.Application creates an object of requested controller. 6.Action reads a post model whose ID is 1 7.Action renders a view 8.View reads and display data from post model 9.View execute some widgets 10.View embeds the result in a layout 11.Action completes the rendering and display result to the user

13 page - 10 Yii Framework Folder Structure FolderDescription/Contains Assets/Published resources Css/Css files Images/Image files Protected/Application Files Themes/Application themes Our Project folder contains 5 folders

14 page - 11 Protected/ Protected folder is a base folder contains 12 sub folders FolderDescription/contains Commands/Customized yiic commands Components/Reusable user components Config/Configuration files Controllers/Controller files Data/Database oriented files Extensions/3 rd party extensions Messages/Translated messages Migrations/ Models/Model files (our business logics)

15 page - 12 Contd.. FolderDescription/Contains Runtime/Temporarily generated files Tests/Test scripts Views/View and layout files

16 page - 13 Important Folders of Yii Framework  Config  Controllers  Models  Views Inside Protected folder

17 page - 14 Config/  main.php is the application configuration file  Contains application level configurations such as application path, name, database configuration and etc.., Contains Application Configuration file

18 page - 15 Controllers/  File name must be same as class name  All Controllers must starts with Capital letter and end with Controller  All controller classes must extends Controller class (located @ located at protected/ components/Controller.php )  Example: For site controller File name: SiteController.php Class name: SiteController D Contains our controllers

19 page - 16 Models/  ContactForm used by SiteController to manage contact form data.  LoginForm used by SiteController to manage login action.  And other Models Files(database).  All Business logics are resides here. Contains ContactForm, LoginForm and our database models etc..,

20 page - 17 Views/  Each Controller has its view files.  Controller name is Same as the folder name except the word Controller.  Layout files are reside inside layout folder. Contains View files for each controllers and layout of the website

21 page - 1 Eof Overview Thank You...


Download ppt "Overview of Framework by Ahamed Rifaudeen A. page - i Steps before entering into the Framework?  Basic knowledge of object-oriented programming (OOP)"

Similar presentations


Ads by Google