logging in or signing up yii_framework_by_honey honey211 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 396 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: April 24, 2011 This Presentation is Public Favorites: 0 Presentation Description introduction to Yii_framework_php Comments Posting comment... Premium member Presentation Transcript Yii [easy, efficient and extensible php framework]: Yii [ easy, efficient and extensible php framework] Honeyson Joseph D Roll no : 511 S5 MCA TKMCE KOLLAM 1introduction: introduction - Yii is a high-performance component-based PHP framework for developing large-scale Web applications - Yii is a generic Web programming framework, used for developing virtually all sorts of Web applications - Yii is a Model View Controller framework 2FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Model-View-Controller (MVC) Entry Script Debug Mode Application Application Base Directory Action Layout Widget etc.. 3FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Model-View-Controller (MVC) In MVC , model represents the data and the business rules; view contains elements of the user interface such as text, form inputs; and the controller manages the communication between the model and the view. MVC separate business logic from user interface considerations to easily change each part without affecting the other. Yii uses a front-controller, called application, which represents the execution context of request processing. 4FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Entry Script Entry script is the bootstrap PHP script that handles user requests initially. It is the only PHP script that end users can directly request to execute Debug Mode Yii application can run in either debug or production mode according to the constant value YII DEBUG. By default, this constant value is defined as false, meaning production mode. To run in debug mode, define this constant as true before including the yii.php file 5FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Application Application represents the execution context of request processing. The application singleton can be accessed at any place via Yii::app(). Application Base Directory Application base directory refers to the root directory that contains all security-sensitive PHP scripts and data. By default, it is a subdirectory named protected that is located under the directory containing the entry script 6FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Controller A controller is an instance of CController or its child class created by application . When a controller runs, it performs the requested action which usually brings in the needed models and renders an appropriate view An action can be defined as a method whose name starts with the word action. An action class and ask the controller to instantiate tasks when requested Action 7FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Layouts Layout is a special view that is used to decorate views. It usually contains portions of user interface that are common among several views Widget A widget is an instance of CWidget or its child class. It is a component mainly for presentational purpose. Widgets enable better reusability in user interface. Widgets are usually embedded in a view script to generate some complex yet self-contained user interface. For example, a calendar widget can be used to make a complex calendar user interface. 8A Typical Workflow OF Yii: A Typical Workflow OF Yii 9CREATING AN Yii APPLICATION: CREATING AN Yii APPLICATION For creating Web application we use a powerful yiic tool which can be used to automate code creation for certain tasks. For simply, we assume that YiiRoot is the directory where Yii is installed, and WebRoot is the document root of our Web server. 10CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 0. Preparation After installing the Yii framework, run a simple console command “% YiiRoot/framework/yiic webapp WebRoot/testdrive “ to generate a skeleton Web application built with Yii. This will create a skeleton Yii application under the directory WebRoot/testdrive. 11CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) 12CREATING AN Yii APPLICATION(contd..) : CREATING AN Yii APPLICATION(contd..) Step 1. Create the Database While Yii can virtually eliminate most repetitive coding tasks, you are responsible for the real creative work. This often starts with designing the whole system to be built, in terms of some database schema. 13CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 2a. Yii Generates the Model Classes Using the built-in Web-based code generator, you can turn database table definitions into model classes instantly, without writing a single line of code. The model classes will allow you to access the database tables in an object-oriented fashion. 14CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) 15CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 2b. Yii Generates the CRUD Code Using the code generator, we can further generate code that implements the typical CRUD (create, read, update, delete) features for the selected database tables. The generated code is highly usable and customizable, following the well-adopted MVC (model-view-controller) design pattern. 16CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) 17CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 3. You customize the code to fit your exact needs Finally we customize the code to fit our exact needs. For example, to hide the password column on the user administration page, simply cross out the 'password' element shown in the user admin view file: 18features of Yii: features of Yii - Database Access Objects (DAO), Query Builder Yii allows developers to c reate model database data in terms of objects and avoid the deadliness and complexity of writing repetitive SQL statements. 19features of Yii(contd..): features of Yii(contd..) - Form input and validation Yii makes collecting form input extremely easy and safe. It comes with a set of validates as well as numerous helper methods and widgets to simplify the task for form input and validation. Authentication and authorization Yii has built-in authentication support. It also supports authorization via hierarchical role-based access control 20features of Yii(contd..): features of Yii(contd..) - Skinning and theming Yii implements a skinning and theming mechanism that allows you to quickly switch the outlook of a Yii-power website. Layered caching scheme Yii supports data caching, page caching, fragment caching and dynamic content. The storage medium of caching can be changed easily without touching the application code. 21features of Yii(contd..): features of Yii(contd..) Automatic code generation Yii provides a set of spontaneous and highly extensible code generation tools that can help you quickly generate the code you need for features such as form input, CRUD. Purely object-oriented Yii framework sticks to strict OOP paradigm. It does not define any global function or variable. And the class hierarchy that it defines allows maximum reusability and customization. 22features of Yii(contd..): features of Yii(contd..) Error handling and logging Errors are handled and presented more nicely, and log messages can be categorized, filtered and routed to different destinations. Security Yii is equipped with many security measures to help prevent your Web applications from attacks such as SQL injection, cookie tampering etc. 23Disadvantages of Yii framework: Disadvantages of Yii framework Yii is written in approach that does not support the most innovative, modern advantages brought to PHP development world with release of PHP 5.3 and soon – PHP version 6. 24Conclusion: Conclusion Yii does not need to be installed under a Web-accessible directory. An Yii application has one entry script which is usually the only file that needs to be exposed to Web users. Other PHP scripts, including those from Yii, should be protected from Web access since they may be exploited for hacking. 25References: References [1] www.code.google.com/yii/ [2] Wikipedia – Yii [3] http://www.yiiframework.com 26 You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
yii_framework_by_honey honey211 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 396 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: April 24, 2011 This Presentation is Public Favorites: 0 Presentation Description introduction to Yii_framework_php Comments Posting comment... Premium member Presentation Transcript Yii [easy, efficient and extensible php framework]: Yii [ easy, efficient and extensible php framework] Honeyson Joseph D Roll no : 511 S5 MCA TKMCE KOLLAM 1introduction: introduction - Yii is a high-performance component-based PHP framework for developing large-scale Web applications - Yii is a generic Web programming framework, used for developing virtually all sorts of Web applications - Yii is a Model View Controller framework 2FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Model-View-Controller (MVC) Entry Script Debug Mode Application Application Base Directory Action Layout Widget etc.. 3FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Model-View-Controller (MVC) In MVC , model represents the data and the business rules; view contains elements of the user interface such as text, form inputs; and the controller manages the communication between the model and the view. MVC separate business logic from user interface considerations to easily change each part without affecting the other. Yii uses a front-controller, called application, which represents the execution context of request processing. 4FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Entry Script Entry script is the bootstrap PHP script that handles user requests initially. It is the only PHP script that end users can directly request to execute Debug Mode Yii application can run in either debug or production mode according to the constant value YII DEBUG. By default, this constant value is defined as false, meaning production mode. To run in debug mode, define this constant as true before including the yii.php file 5FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Application Application represents the execution context of request processing. The application singleton can be accessed at any place via Yii::app(). Application Base Directory Application base directory refers to the root directory that contains all security-sensitive PHP scripts and data. By default, it is a subdirectory named protected that is located under the directory containing the entry script 6FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Controller A controller is an instance of CController or its child class created by application . When a controller runs, it performs the requested action which usually brings in the needed models and renders an appropriate view An action can be defined as a method whose name starts with the word action. An action class and ask the controller to instantiate tasks when requested Action 7FUNDAMENTALS OF Yii: FUNDAMENTALS OF Yii Layouts Layout is a special view that is used to decorate views. It usually contains portions of user interface that are common among several views Widget A widget is an instance of CWidget or its child class. It is a component mainly for presentational purpose. Widgets enable better reusability in user interface. Widgets are usually embedded in a view script to generate some complex yet self-contained user interface. For example, a calendar widget can be used to make a complex calendar user interface. 8A Typical Workflow OF Yii: A Typical Workflow OF Yii 9CREATING AN Yii APPLICATION: CREATING AN Yii APPLICATION For creating Web application we use a powerful yiic tool which can be used to automate code creation for certain tasks. For simply, we assume that YiiRoot is the directory where Yii is installed, and WebRoot is the document root of our Web server. 10CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 0. Preparation After installing the Yii framework, run a simple console command “% YiiRoot/framework/yiic webapp WebRoot/testdrive “ to generate a skeleton Web application built with Yii. This will create a skeleton Yii application under the directory WebRoot/testdrive. 11CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) 12CREATING AN Yii APPLICATION(contd..) : CREATING AN Yii APPLICATION(contd..) Step 1. Create the Database While Yii can virtually eliminate most repetitive coding tasks, you are responsible for the real creative work. This often starts with designing the whole system to be built, in terms of some database schema. 13CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 2a. Yii Generates the Model Classes Using the built-in Web-based code generator, you can turn database table definitions into model classes instantly, without writing a single line of code. The model classes will allow you to access the database tables in an object-oriented fashion. 14CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) 15CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 2b. Yii Generates the CRUD Code Using the code generator, we can further generate code that implements the typical CRUD (create, read, update, delete) features for the selected database tables. The generated code is highly usable and customizable, following the well-adopted MVC (model-view-controller) design pattern. 16CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) 17CREATING AN Yii APPLICATION(contd..): CREATING AN Yii APPLICATION(contd..) Step 3. You customize the code to fit your exact needs Finally we customize the code to fit our exact needs. For example, to hide the password column on the user administration page, simply cross out the 'password' element shown in the user admin view file: 18features of Yii: features of Yii - Database Access Objects (DAO), Query Builder Yii allows developers to c reate model database data in terms of objects and avoid the deadliness and complexity of writing repetitive SQL statements. 19features of Yii(contd..): features of Yii(contd..) - Form input and validation Yii makes collecting form input extremely easy and safe. It comes with a set of validates as well as numerous helper methods and widgets to simplify the task for form input and validation. Authentication and authorization Yii has built-in authentication support. It also supports authorization via hierarchical role-based access control 20features of Yii(contd..): features of Yii(contd..) - Skinning and theming Yii implements a skinning and theming mechanism that allows you to quickly switch the outlook of a Yii-power website. Layered caching scheme Yii supports data caching, page caching, fragment caching and dynamic content. The storage medium of caching can be changed easily without touching the application code. 21features of Yii(contd..): features of Yii(contd..) Automatic code generation Yii provides a set of spontaneous and highly extensible code generation tools that can help you quickly generate the code you need for features such as form input, CRUD. Purely object-oriented Yii framework sticks to strict OOP paradigm. It does not define any global function or variable. And the class hierarchy that it defines allows maximum reusability and customization. 22features of Yii(contd..): features of Yii(contd..) Error handling and logging Errors are handled and presented more nicely, and log messages can be categorized, filtered and routed to different destinations. Security Yii is equipped with many security measures to help prevent your Web applications from attacks such as SQL injection, cookie tampering etc. 23Disadvantages of Yii framework: Disadvantages of Yii framework Yii is written in approach that does not support the most innovative, modern advantages brought to PHP development world with release of PHP 5.3 and soon – PHP version 6. 24Conclusion: Conclusion Yii does not need to be installed under a Web-accessible directory. An Yii application has one entry script which is usually the only file that needs to be exposed to Web users. Other PHP scripts, including those from Yii, should be protected from Web access since they may be exploited for hacking. 25References: References [1] www.code.google.com/yii/ [2] Wikipedia – Yii [3] http://www.yiiframework.com 26