Alexandr Makarov - PHP framework Yii

Embed Size (px)

Citation preview

  • 1. PHP- Yii: , Yii core team

2. 2 Yii? Yes It Is MVC, PHP5. Prado, Rails, Symfony, Joomla. 2008 1.0. 2010 1.1. 23 . 6 , , ~30 . 3. 3 Yii? API, , . . - . - . . 4. 4 Yii? > 300 . > 90 . > 7000 . New BSD 5. 5 , , . , , . CLI. . AR. , , . Gii. RBAC. 6. 6 class BlogController extends CController { function actionIndex(){ $criteria = new CDbCriteria(); $posts = Post::model()->findAll($criteria); $this->render('index', array( 'posts' => $posts, )); } function actionView($id){ $post = Post::model()->findByPk($id); if(!$post) throw new CHttpException(404); $this->render('view', array( 'post' => $post, )); } } 7. 7 . . (CAction). . . 8. 8 View

9. 9 View Native PHP, Smarty, Prado, Twig . Layout. CHtml. Partial. Widget, zii. . 10. 10 Active Record $posts = Post::model() ->taggedWith(array('yii', 'WebConf'))->published()- >with('comments')- >findAll(); foreach($posts as $post){ $post->text = ''; $post->save(); echo $post->id; } 11. 11 mixin Ruby. + . = . Taggable. Commentable. 12. 12 Yii 13. 13 , Yii . . . ;) . . 14. 14 . Jeffrey Winesett. . 14 Yii 1.1.5 . . PHP 5.3 namespace. . 15. 15 http://code.google.com/p/yii2/ 2011 PHP 5.3+ . . . . MANY_MANY. ( 1.1). CSS. ? ? 16. 16 ? ? ? http://www.yiiframework.com/ http://www.yiiframework.ru/ http://rmcreative.ru/