assetManager
component assetManager
configured as follows: [ 'components' => [ 'assetManager' => [ 'converter' => [ 'forceConvert' => true, ] ] ] ];
SELECT
: $subQuery = (new Query)->select('COUNT(*)')->from('user'); $query = (new Query)->select(['id', 'count' => $subQuery])->from('post'); // $query represents the following SQL: // SELECT `id`, (SELECT COUNT(*) FROM `user`) AS `count` FROM `post`
YiiAsset
registration is YiiAsset
as shown below: yii\web\YiiAsset::register($view);
yii cache/flush-schema
Html::cssFile()
method now supports the noscript
option, intended to wrap the generated link
tag into a noscript
tag. This option can also be used when setting AssetBundle::cssOptions
. For example: use yii\helpers\Html; echo Html::cssFile('/css/jquery.fileupload-noscript.css', ['noscript' => true]);
StringHelper::truncate()
supported trimming a simple string to a specified number of characters or words. HTML is now supported, which remains completely valid when trimming.Inflector
acquired a new method, sentence()
, which gathers an array of words into a sentence. For example: use yii\helpers\Inflector; $words = ['Spain', 'France']; echo Inflector::sentence($words); // output: Spain and France $words = ['Spain', 'France', 'Italy']; echo Inflector::sentence($words); // output: Spain, France and Italy $words = ['Spain', 'France', 'Italy']; echo Inflector::sentence($words, ' & '); // output: Spain, France & Italy
composer.json
.yii\bootstrap\ButtonDropdown::$containerOptions
.yii\bootstrap\Modal::$headerOptions
.yii\bootstrap\Modal::$footerOptions
.yii\bootstrap\Tabs::renderTabContent
.yii\bootstrap\ButtonDropdown::$containerOptions
.findAndModify
operation findAndModify
now supported by both yii\mongodb\Query
and yii\mongodb\ActiveQuery
. For example: User::find()->where(['status' => 'new'])->modify(['status' => 'processing']);
[ 'class' => 'yii\debug\Module', 'panels' => [ 'mongodb' => [ 'class' => 'yii\mongodb\debug\MongoDbPanel', ] ], ]
[ 'class' => 'yii\redis\Connection', 'unixSocket' => '/var/run/redis/redis.sock', ]
Source: https://habr.com/ru/post/245227/
All Articles