pdo_odbc
: 'components'=>array( ...... 'db'=>array( 'class'=>'CDbConnection' 'driverName'=>'mysql', 'connectionString'=>'odbc:Driver={MySQL};Server=127.0.0.1;Database=test', 'username'=>'', 'password'=>'', ), ),
public function relations() { return array( 'recentPostCount'=>array(self::STAT,'Post','author_id','scopes'=>'recentScope'), ); }
JOIN
(that is, use | force | ignore index ()): $users=User::model()->findAll(array( 'select'=>'t.id,t.name', 'with'=>array( 'posts'=>array( 'alias'=>'p', 'select'=>'p.id,p.title', 'joinOptions'=>'USE INDEX(post__user)', ), ), ));
CDbCommand::naturalLeftJoin()
and CDbCommand::naturalRightJoin()
have been added to allow the use of appropriate join types.primaryKey()
primary key of the model through the primaryKey()
method, even if there is a primary key in the table.CFileHelper
added to CFileHelper
:createDirectory()
- creates a directory, setting recursive rights.getExtensionByMimeType()
- defines the file extension by MIME type.mime.types
file.CFileHelper::removeDirectory()
now works fine with symbolic links to directories. You can do “as it was” by passing the traverseSymlinks
key to false
in the options array.absolutePaths
option has been added to CFileHelper::findFiles()
. If you put it intrue
, the method will return absolute paths. true
is the default value.CFileCache
and cacheFileMode
properties cachePathMode
CFileCache
added to cacheFileMode
, which can be used to execute the chmod()
corresponding directories.yiic webapp
to HTML5.CHtml
and CActiveForm
received support for HTML5 input fields such as color, datetime, datetime-local, week, and search.CApcCache
now compatible with APCu.Yii::import()
and Yii::createComponent()
now compatible with third-party class autoloaders, such as the Composer loader.Yii
and YiiBase
were added to startup in composer.json
.X-HTTP-Method-Override
header, which is used to emulate various types of request via POST.getIsPatchRequest()
, getIsPatchViaPostRequest()
and getPatch()
allow you to work with PATCH requests.Request::getPreferredLanguage()
can now choose the best option depending on the supported and requested languages.ErrorHandler::getException()
, which makes it possible to pass it to various third-party APIs.CClientScript
now throws an exception if you try to register a non-existent package.CActiveForm::$clientOptions
errorCallback
. Now you can get into the client validation process.JsonSerializable
.CHtml::beginForm()
learned to work with additional HTTP methods through the hidden field _method
.CPasswordHelper::generateSalt()
now returns salt with cost = $2y$
.CFormatter
learned to work with DateTime
.Source: https://habr.com/ru/post/246477/
All Articles