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