SlideShare a Scribd company logo
Yii 2   What’s new?




               Alexander Makarov,
                     Yii core team
Some statistics
Who uses Yii?
*intranet
2   2
Why?
1.Well-balanced
2.Stable
3.Flexible
4.Well-documented
2011 — beginning of 2012 events
What happened?
• 5 stable Yii 1.1 releases   • Events:
• Yii 1.1 Application           – Yii beer party
  Development Cookbook          – YiiTalk
• Yii for Eclipse PDT,          – YiiConf
  CodeLobster
• Yii → GitHub
First two days
—348 watches
—61 forks
Now
—1134 watches
—240 forks
Yii 1.1.11 will be quite interesting
             release ;)
What’s bad in Yii 1.1?
• AR (finder and record are the same object,
  some API).
• Some classes are in strange places.
• More small things.



     The biggest issue is
                               BC
*
              *                 *



       *                                          
2004       2005   2006   2007       2008   2011




Prado, from 2004 → Yii 1.0, 2008 → Yii 1.1, 2010
Yii 2 team


—3 active core developers: qiang, samdark,
 mdomba.
—github.
—PHP 5.3.8+              —Better structure
—All classes are         —Less entities
 namespaced (yii) and   —Keep good ideas
 w/o prefix
—PSR-0




                                    v2
Documentation
—Larry Ullman, author of 22 excellent IT-books
 and a great article series about Yii will write a
 book about Yii2 + will participate in official
 documentation writing.
—API docs will be at least same quality as 1.1.
—Code style guide.
—There’s a plan to release documentation tool
 to the public.
Yii2: base
— Aliases in form of     class MyComponent extends
  @yii/base/Component    yiibaseObject
                         {
— CComponent →             public $x;
  Object + Component       public function __construct($a, $b)
— SPL replaced most of     {
  collections                  //…
                           }
— Removed
                         }
  CFormModel. Now
  you can use Model      $component = MyComponent::newInstance(
  directly.                array('x'=>10),
                           'a', 'b'
                         );
Yii2: View Object
         —render(), widget(),
          beginCache() →
          viewObject
         —In a View: $owner =
          class that uses view
         —$this = View.
         —No need for renderer.
         —Can be used in console
          applications.
         —CHtml is still there.
Yii2: events
$post->on('add',          • No need to
function($event) { ...      explicitly declare
});                         before raising
                          • jQuery-like syntax
$post->trigger('add',     • Behaviors instead of
new Event($this));          filters

$post->off('add',
$callback);

$handlers = $post-
>getEventHandlers('add'
);
Yii2: Query object

// Query object
$query = new Query;
$query->select('id')->from('tbl_customer')->limit(10);
$command = $db->createCommand($query);
$this->assertEquals("SELECT `id` FROM `tbl_customer`
LIMIT 10", $command->sql);

// array
$command = $db->createCommand(array(
       'select' => 'name',
       'from' => 'tbl_customer',
));
Yii2: AR
$customer = Customer::find(2)   – Finder / Model
       ->active()               – Can create your own
       ->one();                   finder
$customer->name = 'Qiang';
                                – ::model()
$customer->save();
                                – Auto quoting.
$customers = Customer::find()   – Method chains.
       ->order('id')
       ->asArray(true)
       ->all();
Yii2: AR
$postFinder = Post::find()       – Criteria
  ->where(array(                 – Can merge two finders
    'active' => true
                                 – Can add conditions on
));
                                   the fly
if($isPrivate) {
  $postFinder->addWhere(array(
    'createdBy' => $userId,
  ));
}
$posts = $postFinder
  ->mergeWith($anotherFinder)
  ->all();
Yii2: AR
                            class Customer extends ActiveRecord {
– tableName(),                      const STATUS_ACTIVE = 1;
  relations(), scopes() =
                                    public static function tableName() {
  static.                                   return 'tbl_customer';

– Relations are                     }

  HAS_ONE,                          public static function relations() {

  HAS_MANY.                                 return array(
                                                    'orders:Order[]' => array(
– link = FKs                => 'id'),
                                                            'link' => array('customer_id'


– via = through                             );
                                                    ),


– Anonymous functions               }

  for scopes.                       public static function scopes() {

– "@." and "?" tokens:                      return array(
                                                    'active' => function($q) {
  own table, external                                       return $q-
                            >andWhere('@.`status` = ' . self::STATUS_ACTIVE);
  table.                                            },
                                            );
                                    }
                            }
Yii2: AR
$customers =                 $customers =
Customer::find()->           Customer::find()->active()
asArray()->all();            ->all();

foreach (Customer::find()    $customers =
as $customer)                Customer::find()
                             ->where('name like :name',
$count = Customer::count()   array(
->value();                     ':name' => '%customer%‘
                             ))->order('id')->all();
TODO (if there will be enough time)
•   HTTP (CURL) wrapper    • jQueryUI-based widgets
•   Package manager        • Commercial support
•   Mailer
•   Twitter Bootstrap
•   Debug toolbar
•   Console requirements
•   More helpers
1 or 2?



Don’t wait. Work with stable one.
When?
Before alpha code will be   •   Base for caching
put into public github      •   Base for i18n
repository we need to       •   Controller + webapp
finish at least these
things→                     •   Base for widgets
                            •   URL manager
Want more info?
—http://www.yiiframework.co
 m/forum/index.php/forum/4
 2-design-discussions-for-yii-
 20/
Questions?


yiiframework.com
 yiiframework.ru
   rmcreative.ru

More Related Content

What's hot

State of search | drupal dinner
State of search | drupal dinnerState of search | drupal dinner
State of search | drupal dinner
Joris Vercammen
 
C# advanced topics and future - C#5
C# advanced topics and future - C#5C# advanced topics and future - C#5
C# advanced topics and future - C#5
Peter Gfader
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi Applications
Effie Arditi
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframework
maltiyadav
 
Maximizer 2018 API training
Maximizer 2018 API trainingMaximizer 2018 API training
Maximizer 2018 API training
Murylo Batista
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
Oro Inc.
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApi
Raffaele Rialdi
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
Krishna Srikanth Manda
 
JWT - Sécurisez vos APIs
JWT - Sécurisez vos APIsJWT - Sécurisez vos APIs
JWT - Sécurisez vos APIs
André Tapia
 
PHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQLPHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQL
kulor
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
Sparkhound Inc.
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
AvitoTech
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
Ivano Malavolta
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
John Calvert
 
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
mfrancis
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkBo-Yi Wu
 
Resting with OroCRM Webinar
Resting with OroCRM WebinarResting with OroCRM Webinar
Resting with OroCRM Webinar
Oro Inc.
 

What's hot (19)

State of search | drupal dinner
State of search | drupal dinnerState of search | drupal dinner
State of search | drupal dinner
 
C# advanced topics and future - C#5
C# advanced topics and future - C#5C# advanced topics and future - C#5
C# advanced topics and future - C#5
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi Applications
 
Intorduction of Playframework
Intorduction of PlayframeworkIntorduction of Playframework
Intorduction of Playframework
 
Maximizer 2018 API training
Maximizer 2018 API trainingMaximizer 2018 API training
Maximizer 2018 API training
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApi
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
JWT - Sécurisez vos APIs
JWT - Sécurisez vos APIsJWT - Sécurisez vos APIs
JWT - Sécurisez vos APIs
 
PHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQLPHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQL
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
 
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP Framework
 
Resting with OroCRM Webinar
Resting with OroCRM WebinarResting with OroCRM Webinar
Resting with OroCRM Webinar
 

Viewers also liked

Yii PHP MVC Framework presentation silicongulf.com
Yii PHP MVC Framework presentation silicongulf.comYii PHP MVC Framework presentation silicongulf.com
Yii PHP MVC Framework presentation silicongulf.com
Christopher Cubos
 
Yii Framework
Yii FrameworkYii Framework
Yii Framework
Jason Ragsdale
 
Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplications
Giuliano Iacobelli
 
Yii Introduction
Yii IntroductionYii Introduction
Yii Introduction
Chandra S Oemarjadi
 
Introduce Yii
Introduce YiiIntroduce Yii
Introduce Yii
zakieh alizadeh
 
Yii Training session-1
Yii Training session-1Yii Training session-1
Yii Training session-1
AkkiCredencys
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
IlPeach
 
1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.
1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.
1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.Bicol IT.org
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
Alexander Makarov
 
A site in 15 minutes with yii
A site in 15 minutes with yiiA site in 15 minutes with yii
A site in 15 minutes with yii
Andy Kelk
 
Yii framework
Yii frameworkYii framework
Yii framework
Pratik Gondaliya
 
Yii framework
Yii frameworkYii framework
Yii framework
Leena Roja
 
Introduction Yii Framework
Introduction Yii FrameworkIntroduction Yii Framework
Introduction Yii Framework
Tuan Nguyen
 

Viewers also liked (15)

Yii PHP MVC Framework presentation silicongulf.com
Yii PHP MVC Framework presentation silicongulf.comYii PHP MVC Framework presentation silicongulf.com
Yii PHP MVC Framework presentation silicongulf.com
 
Yii Framework
Yii FrameworkYii Framework
Yii Framework
 
Get things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplicationsGet things done with Yii - quickly build webapplications
Get things done with Yii - quickly build webapplications
 
Yii Introduction
Yii IntroductionYii Introduction
Yii Introduction
 
Introduce Yii
Introduce YiiIntroduce Yii
Introduce Yii
 
Yii Training session-1
Yii Training session-1Yii Training session-1
Yii Training session-1
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
 
1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.
1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.
1ST TECH TALK: "Yii : The MVC framework" by Benedicto B. Balilo Jr.
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
Yii workshop
Yii workshopYii workshop
Yii workshop
 
A site in 15 minutes with yii
A site in 15 minutes with yiiA site in 15 minutes with yii
A site in 15 minutes with yii
 
Yii framework
Yii frameworkYii framework
Yii framework
 
yii framework
yii frameworkyii framework
yii framework
 
Yii framework
Yii frameworkYii framework
Yii framework
 
Introduction Yii Framework
Introduction Yii FrameworkIntroduction Yii Framework
Introduction Yii Framework
 

Similar to YiiConf 2012 - Alexander Makarov - Yii2, what's new

Yii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading toYii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading to
Alexander Makarov
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
Leonardo Proietti
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2
Elizabeth Smith
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
Michelangelo van Dam
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
Michelangelo van Dam
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
Jonathan Wage
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsJarod Ferguson
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
Benjamin Eberlei
 
Doctrine for NoSQL
Doctrine for NoSQLDoctrine for NoSQL
Doctrine for NoSQL
Benjamin Eberlei
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
Kris Wallsmith
 
Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09
Michelangelo van Dam
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
Konstantin Kudryashov
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
Kacper Gunia
 
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnConYour code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnCon
Rafael Dohms
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntity
Basuke Suzuki
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)Night Sailer
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
Nick Lee
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix it
Rafael Dohms
 

Similar to YiiConf 2012 - Alexander Makarov - Yii2, what's new (20)

Yii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading toYii, frameworks and where PHP is heading to
Yii, frameworks and where PHP is heading to
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Migrare da symfony 1 a Symfony2
 Migrare da symfony 1 a Symfony2  Migrare da symfony 1 a Symfony2
Migrare da symfony 1 a Symfony2
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
 
Doctrine for NoSQL
Doctrine for NoSQLDoctrine for NoSQL
Doctrine for NoSQL
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09Spl Not A Bridge Too Far phpNW09
Spl Not A Bridge Too Far phpNW09
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnConYour code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnCon
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntity
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix it
 

More from Alexander Makarov

UWDC 2013, Как мы используем Yii
UWDC 2013, Как мы используем YiiUWDC 2013, Как мы используем Yii
UWDC 2013, Как мы используем YiiAlexander Makarov
 
UWDC 2013, Yii2
UWDC 2013, Yii2UWDC 2013, Yii2
UWDC 2013, Yii2
Alexander Makarov
 
DevConf 2012 - Yii, его разработка и Yii2
DevConf 2012 - Yii, его разработка и Yii2DevConf 2012 - Yii, его разработка и Yii2
DevConf 2012 - Yii, его разработка и Yii2Alexander Makarov
 
YiiConf 2012 - Alexander Makarov - Yii2, что нового
YiiConf 2012 - Alexander Makarov - Yii2, что новогоYiiConf 2012 - Alexander Makarov - Yii2, что нового
YiiConf 2012 - Alexander Makarov - Yii2, что новогоAlexander Makarov
 
UWDC'12, Александр Макаров, Yii, его разработка и Yii2
UWDC'12, Александр Макаров, Yii, его разработка и Yii2UWDC'12, Александр Макаров, Yii, его разработка и Yii2
UWDC'12, Александр Макаров, Yii, его разработка и Yii2Alexander Makarov
 
UWDC'12, Александр Макаров, О командной разработке и фреймворках
UWDC'12, Александр Макаров, О командной разработке и фреймворкахUWDC'12, Александр Макаров, О командной разработке и фреймворках
UWDC'12, Александр Макаров, О командной разработке и фреймворкахAlexander Makarov
 
Devconf 2011 - PHP - Как разрабатывается фреймворк Yii
Devconf 2011 - PHP - Как разрабатывается фреймворк YiiDevconf 2011 - PHP - Как разрабатывается фреймворк Yii
Devconf 2011 - PHP - Как разрабатывается фреймворк Yii
Alexander Makarov
 
Выбираем PHP-фреймворк. Особенности разработки с фреймворками
Выбираем PHP-фреймворк. Особенности разработки с фреймворкамиВыбираем PHP-фреймворк. Особенности разработки с фреймворками
Выбираем PHP-фреймворк. Особенности разработки с фреймворками
Alexander Makarov
 

More from Alexander Makarov (10)

UWDC 2013, Как мы используем Yii
UWDC 2013, Как мы используем YiiUWDC 2013, Как мы используем Yii
UWDC 2013, Как мы используем Yii
 
UWDC 2013, Yii2
UWDC 2013, Yii2UWDC 2013, Yii2
UWDC 2013, Yii2
 
DevConf 2012 - Yii, его разработка и Yii2
DevConf 2012 - Yii, его разработка и Yii2DevConf 2012 - Yii, его разработка и Yii2
DevConf 2012 - Yii, его разработка и Yii2
 
YiiConf 2012 - Alexander Makarov - Yii2, что нового
YiiConf 2012 - Alexander Makarov - Yii2, что новогоYiiConf 2012 - Alexander Makarov - Yii2, что нового
YiiConf 2012 - Alexander Makarov - Yii2, что нового
 
UWDC'12, Александр Макаров, Yii, его разработка и Yii2
UWDC'12, Александр Макаров, Yii, его разработка и Yii2UWDC'12, Александр Макаров, Yii, его разработка и Yii2
UWDC'12, Александр Макаров, Yii, его разработка и Yii2
 
UWDC'12, Александр Макаров, О командной разработке и фреймворках
UWDC'12, Александр Макаров, О командной разработке и фреймворкахUWDC'12, Александр Макаров, О командной разработке и фреймворках
UWDC'12, Александр Макаров, О командной разработке и фреймворках
 
Devconf 2011 - PHP - Как разрабатывается фреймворк Yii
Devconf 2011 - PHP - Как разрабатывается фреймворк YiiDevconf 2011 - PHP - Как разрабатывается фреймворк Yii
Devconf 2011 - PHP - Как разрабатывается фреймворк Yii
 
Как разраба
Как разрабаКак разраба
Как разраба
 
Выбираем PHP-фреймворк. Особенности разработки с фреймворками
Выбираем PHP-фреймворк. Особенности разработки с фреймворкамиВыбираем PHP-фреймворк. Особенности разработки с фреймворками
Выбираем PHP-фреймворк. Особенности разработки с фреймворками
 
Yii rit 2010
Yii rit 2010Yii rit 2010
Yii rit 2010
 

Recently uploaded

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

YiiConf 2012 - Alexander Makarov - Yii2, what's new

  • 1. Yii 2 What’s new? Alexander Makarov, Yii core team
  • 2.
  • 4.
  • 5.
  • 8.
  • 9. 2 2
  • 10. Why?
  • 12. 2011 — beginning of 2012 events
  • 13. What happened? • 5 stable Yii 1.1 releases • Events: • Yii 1.1 Application – Yii beer party Development Cookbook – YiiTalk • Yii for Eclipse PDT, – YiiConf CodeLobster • Yii → GitHub
  • 14.
  • 15. First two days —348 watches —61 forks
  • 17. Yii 1.1.11 will be quite interesting release ;)
  • 18. What’s bad in Yii 1.1? • AR (finder and record are the same object, some API). • Some classes are in strange places. • More small things. The biggest issue is BC
  • 19. * * * *  2004 2005 2006 2007 2008 2011 Prado, from 2004 → Yii 1.0, 2008 → Yii 1.1, 2010
  • 20. Yii 2 team —3 active core developers: qiang, samdark, mdomba. —github.
  • 21. —PHP 5.3.8+ —Better structure —All classes are —Less entities namespaced (yii) and —Keep good ideas w/o prefix —PSR-0 v2
  • 22. Documentation —Larry Ullman, author of 22 excellent IT-books and a great article series about Yii will write a book about Yii2 + will participate in official documentation writing. —API docs will be at least same quality as 1.1. —Code style guide. —There’s a plan to release documentation tool to the public.
  • 23. Yii2: base — Aliases in form of class MyComponent extends @yii/base/Component yiibaseObject { — CComponent → public $x; Object + Component public function __construct($a, $b) — SPL replaced most of { collections //… } — Removed } CFormModel. Now you can use Model $component = MyComponent::newInstance( directly. array('x'=>10), 'a', 'b' );
  • 24. Yii2: View Object —render(), widget(), beginCache() → viewObject —In a View: $owner = class that uses view —$this = View. —No need for renderer. —Can be used in console applications. —CHtml is still there.
  • 25. Yii2: events $post->on('add', • No need to function($event) { ... explicitly declare }); before raising • jQuery-like syntax $post->trigger('add', • Behaviors instead of new Event($this)); filters $post->off('add', $callback); $handlers = $post- >getEventHandlers('add' );
  • 26. Yii2: Query object // Query object $query = new Query; $query->select('id')->from('tbl_customer')->limit(10); $command = $db->createCommand($query); $this->assertEquals("SELECT `id` FROM `tbl_customer` LIMIT 10", $command->sql); // array $command = $db->createCommand(array( 'select' => 'name', 'from' => 'tbl_customer', ));
  • 27. Yii2: AR $customer = Customer::find(2) – Finder / Model ->active() – Can create your own ->one(); finder $customer->name = 'Qiang'; – ::model() $customer->save(); – Auto quoting. $customers = Customer::find() – Method chains. ->order('id') ->asArray(true) ->all();
  • 28. Yii2: AR $postFinder = Post::find() – Criteria ->where(array( – Can merge two finders 'active' => true – Can add conditions on )); the fly if($isPrivate) { $postFinder->addWhere(array( 'createdBy' => $userId, )); } $posts = $postFinder ->mergeWith($anotherFinder) ->all();
  • 29. Yii2: AR class Customer extends ActiveRecord { – tableName(), const STATUS_ACTIVE = 1; relations(), scopes() = public static function tableName() { static. return 'tbl_customer'; – Relations are } HAS_ONE, public static function relations() { HAS_MANY. return array( 'orders:Order[]' => array( – link = FKs => 'id'), 'link' => array('customer_id' – via = through ); ), – Anonymous functions } for scopes. public static function scopes() { – "@." and "?" tokens: return array( 'active' => function($q) { own table, external return $q- >andWhere('@.`status` = ' . self::STATUS_ACTIVE); table. }, ); } }
  • 30. Yii2: AR $customers = $customers = Customer::find()-> Customer::find()->active() asArray()->all(); ->all(); foreach (Customer::find() $customers = as $customer) Customer::find() ->where('name like :name', $count = Customer::count() array( ->value(); ':name' => '%customer%‘ ))->order('id')->all();
  • 31. TODO (if there will be enough time) • HTTP (CURL) wrapper • jQueryUI-based widgets • Package manager • Commercial support • Mailer • Twitter Bootstrap • Debug toolbar • Console requirements • More helpers
  • 32. 1 or 2? Don’t wait. Work with stable one.
  • 33. When? Before alpha code will be • Base for caching put into public github • Base for i18n repository we need to • Controller + webapp finish at least these things→ • Base for widgets • URL manager
  • 34. Want more info? —http://www.yiiframework.co m/forum/index.php/forum/4 2-design-discussions-for-yii- 20/