Yii 2.0 overview - 1 of 2

1,679 views

Published on

Presentation used on the 8th London Yii Framework meetup. Part I of 2 featuring and overview of the changes that will happen on the upcoming version 2.0 of the Yii framework. Presented by Cassiano Surek.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,679
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
19
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Yii 2.0 overview - 1 of 2

  1. 1. Welcome to the London Yii Meetup Hosted by Cass Surek – monthly meetings http://www.meetup.com/London-Yii-Framework-Group/
  2. 2. Venue, beer and snacks kindly provided by www.digitalannexe.co.uk
  3. 3. Tonight Yii 2.0 overview – Cass Yii 2.0 add-on – Marian Zburlea
  4. 4. Yii 2.0 Current version 2.0.0 alpha Based on PHP 5.4.0 Incompatible with 1.1 Not yet ready for production Application templates (basic and advanced) Installation via Composer
  5. 5. Major changes Namespaces Component and Objects Events Path Alias View Class Models Controllers Widgets Console Applications i18N Action Filters Assets Static Helpers ActiveForm Query Builder ActiveRecord Auto-quoting table and column names User and identityInterface URL Management Themes Composer integration
  6. 6. Namespaces • Prefixes no longer used • Based on directory structure e.g. yiiwebRequest
  7. 7. Components and Objects • CComponent split into Object and Component • Object – basic data structures • Component – events/behaviour
  8. 8. Object Config • Uniform way of configuring objects
  9. 9. Object Config
  10. 10. Events • onEvent method definition no longer needed • $component->on($eventName, $handler);
  11. 11. Path Alias • Must use @ • @yii means Yii installation directory • Closely related to class namespaces
  12. 12. View Class • MVC • $this in a view no longer means controller or widget object • Smarty and Twig support added • Prado support removed
  13. 13. Models • formName() returns the form name (previously hardcoded) • Load() and loadMultiple() added to aid data population • New method: scenarios() to define which fields need to be validated • Safe validators discontinued, scenarios() define which are safe
  14. 14. Controllers • Render() and renderPartial() return content instead of sending it out • One must echo contents now
  15. 15. Widgets • Simplified process • Use begin(), end() and widget() instead of passing strings through beginWidget() and endWidget().
  16. 16. Themes • • • • CThemeManager is gone Path maps ['/web/views' => '/web/themes/basic’] /web/views/site/index.php will be /web/themes/basic/site/index.php • Any view file can have a theme, even if rendered outside of the context of a controller
  17. 17. Console applications • Controllers • Console and web controllers have same base class • Console controller is similar to CConsoleCommand
  18. 18. Internationalisation (i18n) • Date and number formatter are out • PECL intl php module is in • I18n application component
  19. 19. Action Filters • Implemented via behaviors now
  20. 20. Marian Zburlea Yii 2.0 Add-on Yii Smart Blog

×