P H P Framework


Published on

Seminar Presentation on YII Framework As a part of PHP Framework by Animesh Kumar (MCA 4th sem KIIT)

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • http://localhost//yii/framework/requirements/index.phpYiiroot/framework/yiicwebappwebroot/testdrive
  • yiicwebapp c:\\xampp\\htdocs\\blog
  • yiicwebapp c:\\xampplite\\htdocs\\blog
  • P H P Framework

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