2. Demo: Creating a full flourished and fullyfunctional web application in 2 minutes Contents Whatis a Framework? Architecture Model viewcontroller(MVC) Features Introducing Yii 2
3.
4. Provids a basic structure for which to build the web applications.
15. What is ?? Yii 7 The name Yii (pronounced as /ji:/) stands for easy, efficient and extensible. High-performance component-based PHP framework for developing large-scaleWeb applications. Requires Web server supporting PHP 5.1.0 or higher.
16. Why? Yii 8 Generic Web programming framework - Can be used for developing virtually all sorts of Web apps, offer greater simplicity & stability Efficient, feature-rich and clearly-documented Light-weighted and equipped with sophisticated caching solutions Especially suitable for developing high-traffic applications, such as portals, forums etc.
18. 10 Index.php Yii Infrastructure request 1 2 3 application 4 5 urlManager controller 5. The application creates an instance of the requested controller to further handle the user request. 6. The action reads a Post model whose id is 1 from the database. 1. A user makes a request with the URL & the server handles it by executing the bootscrap script index.php 3. The application obtains the detailed user request information from an application component named requet 2. The bootscrap script creates an application instance and runs it 4. The application determines the requested controller and action with the help of an application component named urlManager. 7. The action renders a view named show with the post model. 8. The view reads and displays the attributes of the post model. 9. The view executes some widgets (if available). 10. The view rendering result is embedded in a layout. filters 11. The action completes the view rendering and displays the result to the user. 11 action 6 The controller determines that the action show reffers to a method named actionShow in the controller class. model 7 8 It then creates and executes Filters associated with this action. The action is executed only if it is allowed by the filters. View 9 10 Layout widget
19. Getting Started Two Steps Installation : Download Yii Framework from yiiframework.com Unpack the Yii release file to a Web-accessible directory Requires Web server supporting PHP 5.1.0 + Tested with Apache HTTP server on Windows and Linux operating systems Check It- http://hostname/path/to/yii/framework/requirements/index.php 11
20. Creating First Yii Application Assume that YiiRoot is the directory where Yii is installed. Run yiic on the command line as follows: % YiiRoot/framework/yiicwebappWebRoot/testdrive test drive our first Yii application http://hostname/testdrive/index.php 12
21. Steps for creating a blog application Install Yii Create an application Framework Application Workflow Requirement Analysis Overall DB Design Initial Prototyping and building system Create Database Establish Database Connection Scaffolding – CRUD Authenticating User 13
22. Connecting to Database To use a database, we first need to tell the application how to connect to it. This is done by changing the application configuration file WebRoot/testdrive/protected/config/main.php return array( ......'components'=>array( ......'db'=>array( 'connectionString'=>'sqlite:protected/data/source.db', ), ), ...... ); 14
23. Implementing application Create, Read, Update and Delete yiic tool helps to generate the needed code. This process is also known as scaffolding. use the shell command of yiic to interact with our newly created application Just Type …yiipath/CRUD (Model Name) in the command console CRUD 15
24. References:- 16 http://www.yiiframework.com/doc/ http://www.yiiframework.com/wiki/ http://www.amazon.com/gp/product/1847199585?ie=UTF8&tag=gii20f-20&linkCode=xm2&camp=1789&creativeASIN=1847199585 http://en.wikipedia.org/wiki/Yii http://yiidesign.com/ http://www.phpframeworks.com/php-frameworks/index.php?id=19 http://code.google.com/p/yii/ Demo referred from the Video Of Mr. RohitPradhan on YOUTUBE