Yii Introduction

2,046 views

Published on

Simple slide about introduction to yii. I used it in knowledge sharing session with my teammates.

Cover why yii, what rocks on yii, and dark sides of yii.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Yii Introduction

  1. 1. Yii<br />
  2. 2. Outline<br />Why Yii?<br />What rocks on Yii?<br />Dark sides of Yii<br />
  3. 3. Why Yii?<br />Better performance compare to other php frameworks<br />Awesome documentation and tutorial (included in source code package)<br />Less code<br />More features compare to CodeIgniter<br />
  4. 4. http://www.yiiframework.com/performance/<br />
  5. 5. What’s rock in Yii?<br />Gii<br />ActiveRecord (+Relational)<br />Built in authentication<br />User Friendly Url<br />
  6. 6. Gii<br />
  7. 7. Gii<br />Create CRUD in a blink!<br />
  8. 8. Gii<br />Define table<br />Use model generator<br />Use CRUD generator<br />Voila!<br />
  9. 9. ActiveRecord (+Relational)<br />$post = Post::model()->findByPk(2);<br />$comments = $post->comments;<br />foreach($comments as $r){ <br /> echo $r->content;<br />}<br />It works!<br />Requirement:<br />Declare foreign key in MySQL<br />Use gii Model Generator<br />
  10. 10. Built in Authentication<br />Yii provide login form<br />We only need to modify components/UserIdentity to give additional information in user session<br />
  11. 11. User Friendly Url<br />http://localhost/yii/test/createPost<br />
  12. 12. Many More…<br />Caching<br />Theming<br />Etc …<br />
  13. 13. Dark Sides of Yii<br />Slower learing curve<br />

×