1 / 21

Overview of Framework

Overview of Framework. by Ahamed Rifaudeen A. Steps before entering into the Framework?. Required Knowledge?. Basic knowledge of object-oriented programming (OOP) in php5 Database programming (Mysql, Sqlite3)

jamal-hines
Télécharger la présentation

Overview of Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Overview of Framework by Ahamed Rifaudeen A

  2. Steps before entering into the Framework? Required Knowledge? • 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. page - i

  3. Cms Vs  Framework Cms • 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. Framework • A Framework provides often used web development boilerplate code. • They can... • MVC paradigm • URL parsing and handling • Templating • Better request handling page - ii

  4. What is Framework? Definition: • 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 Types of Framework: page - 1

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

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

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

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

  9. Contd.. • Type yiic page - 6

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

  11. 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 page - 8

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

  13. Yii Framework Folder Structure Our Project folder contains 5 folders page - 10

  14. Protected/ Protected folder is a base folder contains 12 sub folders page - 11

  15. Contd.. page - 12

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

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

  18. Controllers/ Contains our controllers D • 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 page - 15

  19. Models/ Contains ContactForm, LoginForm and our database models etc.., • 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. page - 16

  20. Views/ Contains View files for each controllers and layout of the website • 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. page - 17

  21. Eof Overview Thank You... page - 1

More Related