Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. Upgrading Instructions for Yii Framework v2
  2. ===========================================
  3. !!!IMPORTANT!!!
  4. The following upgrading instructions are cumulative. That is,
  5. if you want to upgrade from version A to version C and there is
  6. version B between A and C, you need to follow the instructions
  7. for both A and B.
  8. Make sure you have global install of latest version of composer asset plugin as well as a stable version of composer:
  9. ```
  10. php composer.phar self-update
  11. php composer.phar global require "fxp/composer-asset-plugin:^1.2.0"
  12. ```
  13. Then run:
  14. ```
  15. php composer.phar require "yiisoft/yii2:~2.0.9"
  16. ```
  17. Upgrade from Yii 2.0.9
  18. ----------------------
  19. * RBAC: `getChildRoles()` method was added to `\yii\rbac\ManagerInterface`. If you've implemented your own RBAC manager
  20. you need to implement new method.
  21. * Microsoft SQL `NTEXT` data type [was marked as deprecated](https://msdn.microsoft.com/en-us/library/ms187993.aspx) in MSSQL so
  22. `\yii\db\mssql\Schema::TYPE_TEXT` was changed from `'ntext'` to `'nvarchar(max)'
  23. * Method `yii\web\Request::getBodyParams()` has been changed to pass full value of 'content-type' header to the second
  24. argument of `yii\web\RequestParserInterface::parse()`. If you create your own custom parser, which relies on `$contentType`
  25. argument, ensure to process it correctly as it may content additional data.
  26. * `yii\rest\Serializer` has been changed to return a JSON array for collection data in all cases to be consistent among pages
  27. for data that is not indexed starting by 0. If your API relies on the Serializer to return data as JSON objects indexed by
  28. PHP array keys, you should set `yii\rest\Serializer::$preserveKeys` to `true`.
  29. Upgrade from Yii 2.0.8
  30. ----------------------
  31. * Part of code from `yii\web\User::loginByCookie()` method was moved to new `getIdentityAndDurationFromCookie()`
  32. and `removeIdentityCookie()` methods. If you override `loginByCookie()` method, update it in order use new methods.
  33. * Fixture console command syntax was changed from `yii fixture "*" -User` to `yii fixture "*, -User"`. Upgrade your
  34. scripts if necessary.
  35. Upgrade from Yii 2.0.7
  36. ----------------------
  37. * The signature of `yii\helpers\BaseArrayHelper::index()` was changed. The method has got an extra optional parameter
  38. `$groups`.
  39. * `yii\helpers\BaseArrayHelper` methods `isIn()` and `isSubset()` throw `\yii\base\InvalidParamException`
  40. instead of `\InvalidArgumentException`. If you wrap calls of these methods in try/catch block, change expected
  41. exception class.
  42. * `yii\rbac\ManagerInterface::canAddChild()` method was added. If you have custom backend for RBAC you need to implement
  43. it.
  44. * The signature of `yii\web\User::loginRequired()` was changed. The method has got an extra optional parameter
  45. `$checkAcceptHeader`.
  46. * The signature of `yii\db\ColumnSchemaBuilder::__construct()` was changed. The method has got an extra optional
  47. parameter `$db`. In case you are instantiating this class yourself and using the `$config` parameter, you will need to
  48. move it to the right by one.
  49. * String types in the MSSQL column schema map were upgraded to Unicode storage types. This will have no effect on
  50. existing columns, but any new columns you generate via the migrations engine will now store data as Unicode.
  51. * Output buffering was introduced in the pair of `yii\widgets\ActiveForm::init()` and `::run()`. If you override any of
  52. these methods, make sure that output buffer handling is not corrupted. If you call the parent implementation, when
  53. overriding, everything should work fine. You should be doing that anyway.
  54. Upgrade from Yii 2.0.6
  55. ----------------------
  56. * Added new requirement: ICU Data version >= 49.1. Please, ensure that your environment has ICU data installed and
  57. up to date to prevent unexpected behavior or crashes. This may not be the case on older systems e.g. running Debian Wheezy.
  58. > Tip: Use Yii 2 Requirements checker for easy and fast check. Look for `requirements.php` in root of Basic and Advanced
  59. templates (howto-comment is in head of the script).
  60. * The signature of `yii\helpers\BaseInflector::transliterate()` was changed. The method is now public and has an
  61. extra optional parameter `$transliterator`.
  62. * In `yii\web\UrlRule` the `pattern` matching group names are being replaced with the placeholders on class
  63. initialization to support wider range of allowed characters. Because of this change:
  64. - You are required to flush your application cache to remove outdated `UrlRule` serialized objects.
  65. See the [Cache Flushing Guide](http://www.yiiframework.com/doc-2.0/guide-caching-data.html#cache-flushing)
  66. - If you implement `parseRequest()` or `createUrl()` and rely on parameter names, call `substitutePlaceholderNames()`
  67. in order to replace temporary IDs with parameter names after doing matching.
  68. * The context of `yii.confirm` JavaScript function was changed from `yii` object to the DOM element which triggered
  69. the event.
  70. - If you overrode the `yii.confirm` function and accessed the `yii` object through `this`, you must access it
  71. with global variable `yii` instead.
  72. * Traversable objects are now formatted as arrays in XML response to support SPL objects and Generators. Previous
  73. behavior could be turned on by setting `XmlResponseFormatter::$useTraversableAsArray` to `false`.
  74. * If you've implemented `yii\rbac\ManagerInterface` you need to implement additional method `getUserIdsByRole($roleName)`.
  75. * If you're using ApcCache with APCu, set `useApcu` to `true` in the component config.
  76. * The `yii\behaviors\SluggableBehavior` class has been refactored to make it more reusable.
  77. Added new `protected` methods:
  78. - `isSlugNeeded()`
  79. - `makeUnique()`
  80. The visibility of the following Methods has changed from `private` to `protected`:
  81. - `validateSlug()`
  82. - `generateUniqueSlug()`
  83. * The `yii\console\controllers\MessageController` class has been refactored to be better configurable and now also allows
  84. setting a lot of configuration options via command line. If you extend from this class, make sure it works as expected after
  85. these changes.
  86. Upgrade from Yii 2.0.5
  87. ----------------------
  88. * The signature of the following methods in `yii\console\controllers\MessageController` has changed. They have an extra parameter `$markUnused`.
  89. - `saveMessagesToDb($messages, $db, $sourceMessageTable, $messageTable, $removeUnused, $languages, $markUnused)`
  90. - `saveMessagesToPHP($messages, $dirName, $overwrite, $removeUnused, $sort, $markUnused)`
  91. - `saveMessagesCategoryToPHP($messages, $fileName, $overwrite, $removeUnused, $sort, $category, $markUnused)`
  92. - `saveMessagesToPO($messages, $dirName, $overwrite, $removeUnused, $sort, $catalog, $markUnused)`
  93. Upgrade from Yii 2.0.4
  94. ----------------------
  95. Upgrading from 2.0.4 to 2.0.5 does not require any changes.
  96. Upgrade from Yii 2.0.3
  97. ----------------------
  98. * Updated dependency to `cebe/markdown` to version `1.1.x`.
  99. If you need stick with 1.0.x, you can specify that in your `composer.json` by
  100. adding the following line in the `require` section:
  101. ```json
  102. "cebe/markdown": "~1.0.0",
  103. ```
  104. Upgrade from Yii 2.0.2
  105. ----------------------
  106. Starting from version 2.0.3 Yii `Security` component relies on OpenSSL crypto lib instead of Mcrypt. The reason is that
  107. Mcrypt is abandoned and isn't maintained for years. Therefore your PHP should be compiled with OpenSSL support. Most
  108. probably there's nothing to worry because it is quite typical.
  109. If you've extended `yii\base\Security` to override any of the config constants you have to update your code:
  110. - `MCRYPT_CIPHER` — now encoded in `$cipher` (and hence `$allowedCiphers`).
  111. - `MCRYPT_MODE` — now encoded in `$cipher` (and hence `$allowedCiphers`).
  112. - `KEY_SIZE` — now encoded in `$cipher` (and hence `$allowedCiphers`).
  113. - `KDF_HASH` — now `$kdfHash`.
  114. - `MAC_HASH` — now `$macHash`.
  115. - `AUTH_KEY_INFO` — now `$authKeyInfo`.
  116. Upgrade from Yii 2.0.0
  117. ----------------------
  118. * Upgraded Twitter Bootstrap to [version 3.3.x](http://blog.getbootstrap.com/2014/10/29/bootstrap-3-3-0-released/).
  119. If you need to use an older version (i.e. stick with 3.2.x) you can specify that in your `composer.json` by
  120. adding the following line in the `require` section:
  121. ```json
  122. "bower-asset/bootstrap": "3.2.*",
  123. ```
  124. Upgrade from Yii 2.0 RC
  125. -----------------------
  126. * If you've implemented `yii\rbac\ManagerInterface` you need to add implementation for new method `removeChildren()`.
  127. * The input dates for datetime formatting are now assumed to be in UTC unless a timezone is explicitly given.
  128. Before, the timezone assumed for input dates was the default timezone set by PHP which is the same as `Yii::$app->timeZone`.
  129. This causes trouble because the formatter uses `Yii::$app->timeZone` as the default values for output so no timezone conversion
  130. was possible. If your timestamps are stored in the database without a timezone identifier you have to ensure they are in UTC or
  131. add a timezone identifier explicitly.
  132. * `yii\bootstrap\Collapse` is now encoding labels by default. `encode` item option and global `encodeLabels` property were
  133. introduced to disable it. Keys are no longer used as labels. You need to remove keys and use `label` item option instead.
  134. * The `yii\base\View::beforeRender()` and `yii\base\View::afterRender()` methods have two extra parameters `$viewFile`
  135. and `$params`. If you are overriding these methods, you should adjust the method signature accordingly.
  136. * If you've used `asImage` formatter i.e. `Yii::$app->formatter->asImage($value, $alt);` you should change it
  137. to `Yii::$app->formatter->asImage($value, ['alt' => $alt]);`.
  138. * Yii now requires `cebe/markdown` 1.0.0 or higher, which includes breaking changes in its internal API. If you extend the markdown class
  139. you need to update your implementation. See <https://github.com/cebe/markdown/releases/tag/1.0.0-rc> for details.
  140. If you just used the markdown helper class there is no need to change anything.
  141. * If you are using CUBRID DBMS, make sure to use at least version 9.3.0 as the server and also as the PDO extension.
  142. Quoting of values is broken in prior versions and Yii has no reliable way to work around this issue.
  143. A workaround that may have worked before has been removed in this release because it was not reliable.
  144. Upgrade from Yii 2.0 Beta
  145. -------------------------
  146. * If you are using Composer to upgrade Yii, you should run the following command first (once for all) to install
  147. the composer-asset-plugin, *before* you update your project:
  148. ```
  149. php composer.phar global require "fxp/composer-asset-plugin:~1.0.0"
  150. ```
  151. You also need to add the following code to your project's `composer.json` file:
  152. ```json
  153. "extra": {
  154. "asset-installer-paths": {
  155. "npm-asset-library": "vendor/npm",
  156. "bower-asset-library": "vendor/bower"
  157. }
  158. }
  159. ```
  160. It is also a good idea to upgrade composer itself to the latest version if you see any problems:
  161. ```
  162. php composer.phar self-update
  163. ```
  164. * If you used `clearAll()` or `clearAllAssignments()` of `yii\rbac\DbManager`, you should replace
  165. them with `removeAll()` and `removeAllAssignments()` respectively.
  166. * If you created RBAC rule classes, you should modify their `execute()` method by adding `$user`
  167. as the first parameter: `execute($user, $item, $params)`. The `$user` parameter represents
  168. the ID of the user currently being access checked. Previously, this is passed via `$params['user']`.
  169. * If you override `yii\grid\DataColumn::getDataCellValue()` with visibility `protected` you have
  170. to change visibility to `public` as visibility of the base method has changed.
  171. * If you have classes implementing `yii\web\IdentityInterface` (very common), you should modify
  172. the signature of `findIdentityByAccessToken()` as
  173. `public static function findIdentityByAccessToken($token, $type = null)`. The new `$type` parameter
  174. will contain the type information about the access token. For example, if you use
  175. `yii\filters\auth\HttpBearerAuth` authentication method, the value of this parameter will be
  176. `yii\filters\auth\HttpBearerAuth`. This allows you to differentiate access tokens taken by
  177. different authentication methods.
  178. * If you are sharing the same cache across different applications, you should configure
  179. the `keyPrefix` property of the cache component to use some unique string.
  180. Previously, this property was automatically assigned with a unique string.
  181. * If you are using `dropDownList()`, `listBox()`, `activeDropDownList()`, or `activeListBox()`
  182. of `yii\helpers\Html`, and your list options use multiple blank spaces to format and align
  183. option label texts, you need to specify the option `encodeSpaces` to be true.
  184. * If you are using `yii\grid\GridView` and have configured a data column to use a PHP callable
  185. to return cell values (via `yii\grid\DataColumn::value`), you may need to adjust the signature
  186. of the callable to be `function ($model, $key, $index, $widget)`. The `$key` parameter was newly added
  187. in this release.
  188. * `yii\console\controllers\AssetController` is now using hashes instead of timestamps. Replace all `{ts}` with `{hash}`.
  189. * The database table of the `yii\log\DbTarget` now needs a `prefix` column to store context information.
  190. You can add it with `ALTER TABLE log ADD COLUMN prefix TEXT AFTER log_time;`.
  191. * The `fileinfo` PHP extension is now required by Yii. If you use `yii\helpers\FileHelper::getMimeType()`, make sure
  192. you have enabled this extension. This extension is [builtin](http://www.php.net/manual/en/fileinfo.installation.php) in php above `5.3`.
  193. * Please update your main layout file by adding this line in the `<head>` section: `<?= Html::csrfMetaTags() ?>`.
  194. This change is needed because `yii\web\View` no longer automatically generates CSRF meta tags due to issue #3358.
  195. * If your model code is using the `file` validation rule, you should rename its `types` option to `extensions`.
  196. * `MailEvent` class has been moved to the `yii\mail` namespace. You have to adjust all references that may exist in your code.
  197. * The behavior and signature of `ActiveRecord::afterSave()` has changed. `ActiveRecord::$isNewRecord` will now always be
  198. false in afterSave and also dirty attributes are not available. This change has been made to have a more consistent and
  199. expected behavior. The changed attributes are now available in the new parameter of afterSave() `$changedAttributes`.
  200. `$changedAttributes` contains the old values of attributes that had changed and were saved.
  201. * `ActiveRecord::updateAttributes()` has been changed to not trigger events and not respect optimistic locking anymore to
  202. differentiate it more from calling `update(false)` and to ensure it can be used in `afterSave()` without triggering infinite
  203. loops.
  204. * If you are developing RESTful APIs and using an authentication method such as `yii\filters\auth\HttpBasicAuth`,
  205. you should explicitly configure `yii\web\User::enableSession` in the application configuration to be false to avoid
  206. starting a session when authentication is performed. Previously this was done automatically by authentication method.
  207. * `mail` component was renamed to `mailer`, `yii\log\EmailTarget::$mail` was renamed to `yii\log\EmailTarget::$mailer`.
  208. Please update all references in the code and config files.
  209. * `yii\caching\GroupDependency` was renamed to `TagDependency`. You should create such a dependency using the code
  210. `new \yii\caching\TagDependency(['tags' => 'TagName'])`, where `TagName` is similar to the group name that you
  211. previously used.
  212. * If you are using the constant `YII_PATH` in your code, you should rename it to `YII2_PATH` now.
  213. * You must explicitly configure `yii\web\Request::cookieValidationKey` with a secret key. Previously this is done automatically.
  214. To do so, modify your application configuration like the following:
  215. ```php
  216. return [
  217. // ...
  218. 'components' => [
  219. 'request' => [
  220. 'cookieValidationKey' => 'your secret key here',
  221. ],
  222. ],
  223. ];
  224. ```
  225. > Note: If you are using the `Advanced Project Template` you should not add this configuration to `common/config`
  226. or `console/config` because the console application doesn't have to deal with CSRF and uses its own request that
  227. doesn't have `cookieValidationKey` property.
  228. * `yii\rbac\PhpManager` now stores data in three separate files instead of one. In order to convert old file to
  229. new ones save the following code as `convert.php` that should be placed in the same directory your `rbac.php` is in:
  230. ```php
  231. <?php
  232. $oldFile = 'rbac.php';
  233. $itemsFile = 'items.php';
  234. $assignmentsFile = 'assignments.php';
  235. $rulesFile = 'rules.php';
  236. $oldData = include $oldFile;
  237. function saveToFile($data, $fileName) {
  238. $out = var_export($data, true);
  239. $out = "<?php\nreturn " . $out . ';';
  240. $out = str_replace(['array (', ')'], ['[', ']'], $out);
  241. file_put_contents($fileName, $out);
  242. }
  243. $items = [];
  244. $assignments = [];
  245. if (isset($oldData['items'])) {
  246. foreach ($oldData['items'] as $name => $data) {
  247. if (isset($data['assignments'])) {
  248. foreach ($data['assignments'] as $userId => $assignmentData) {
  249. $assignments[$userId][] = $assignmentData['roleName'];
  250. }
  251. unset($data['assignments']);
  252. }
  253. $items[$name] = $data;
  254. }
  255. }
  256. $rules = [];
  257. if (isset($oldData['rules'])) {
  258. $rules = $oldData['rules'];
  259. }
  260. saveToFile($items, $itemsFile);
  261. saveToFile($assignments, $assignmentsFile);
  262. saveToFile($rules, $rulesFile);
  263. echo "Done!\n";
  264. ```
  265. Run it once, delete `rbac.php`. If you've configured `authFile` property, remove the line from config and instead
  266. configure `itemFile`, `assignmentFile` and `ruleFile`.
  267. * Static helper `yii\helpers\Security` has been converted into an application component. You should change all usage of
  268. its methods to a new syntax, for example: instead of `yii\helpers\Security::hashData()` use `Yii::$app->getSecurity()->hashData()`.
  269. The `generateRandomKey()` method now produces not an ASCII compatible output. Use `generateRandomString()` instead.
  270. Default encryption and hash parameters has been upgraded. If you need to decrypt/validate data that was encrypted/hashed
  271. before, use the following configuration of the 'security' component:
  272. ```php
  273. return [
  274. 'components' => [
  275. 'security' => [
  276. 'derivationIterations' => 1000,
  277. ],
  278. // ...
  279. ],
  280. // ...
  281. ];
  282. ```
  283. * If you are using query caching, you should modify your relevant code as follows, as `beginCache()` and `endCache()` are
  284. replaced by `cache()`:
  285. ```php
  286. $db->cache(function ($db) {
  287. // ... SQL queries that need to use query caching
  288. }, $duration, $dependency);
  289. ```
  290. * Due to significant changes to security you need to upgrade your code to use `\yii\base\Security` component instead of
  291. helper. If you have any data encrypted it should be re-encrypted. In order to do so you can use old security helper
  292. [as explained by @docsolver at github](https://github.com/yiisoft/yii2/issues/4461#issuecomment-50237807).
  293. * [[yii\helpers\Url::to()]] will no longer prefix base URL to relative URLs. For example, `Url::to('images/logo.png')`
  294. will return `images/logo.png` directly. If you want a relative URL to be prefix with base URL, you should make use
  295. of the alias `@web`. For example, `Url::to('@web/images/logo.png')` will return `/BaseUrl/images/logo.png`.
  296. * The following properties are now taking `false` instead of `null` for "don't use" case:
  297. - `yii\bootstrap\NavBar::$brandLabel`.
  298. - `yii\bootstrap\NavBar::$brandUrl`.
  299. - `yii\bootstrap\Modal::$closeButton`.
  300. - `yii\bootstrap\Modal::$toggleButton`.
  301. - `yii\bootstrap\Alert::$closeButton`.
  302. - `yii\widgets\LinkPager::$nextPageLabel`.
  303. - `yii\widgets\LinkPager::$prevPageLabel`.
  304. - `yii\widgets\LinkPager::$firstPageLabel`.
  305. - `yii\widgets\LinkPager::$lastPageLabel`.
  306. * The format of the Faker fixture template is changed. For an example, please refer to the file
  307. `apps/advanced/common/tests/templates/fixtures/user.php`.
  308. * The signature of all file downloading methods in `yii\web\Response` is changed, as summarized below:
  309. - `sendFile($filePath, $attachmentName = null, $options = [])`
  310. - `sendContentAsFile($content, $attachmentName, $options = [])`
  311. - `sendStreamAsFile($handle, $attachmentName, $options = [])`
  312. - `xSendFile($filePath, $attachmentName = null, $options = [])`
  313. * The signature of callbacks used in `yii\base\ArrayableTrait::fields()` is changed from `function ($field, $model) {`
  314. to `function ($model, $field) {`.
  315. * `Html::radio()`, `Html::checkbox()`, `Html::radioList()`, `Html::checkboxList()` no longer generate the container
  316. tag around each radio/checkbox when you specify labels for them. You should manually render such container tags,
  317. or set the `item` option for `Html::radioList()`, `Html::checkboxList()` to generate the container tags.
  318. * The formatter class has been refactored to have only one class regardless whether PHP intl extension is installed or not.
  319. Functionality of `yii\base\Formatter` has been merged into `yii\i18n\Formatter` and `yii\base\Formatter` has been
  320. removed so you have to replace all usage of `yii\base\Formatter` with `yii\i18n\Formatter` in your code.
  321. Also the API of the Formatter class has changed in many ways.
  322. The signature of the following Methods has changed:
  323. - `asDate`
  324. - `asTime`
  325. - `asDatetime`
  326. - `asSize` has been split up into `asSize` and `asShortSize`
  327. - `asCurrency`
  328. - `asDecimal`
  329. - `asPercent`
  330. - `asScientific`
  331. The following methods have been removed, this also means that the corresponding format which may be used by a
  332. GridView or DetailView is not available anymore:
  333. - `asNumber`
  334. - `asDouble`
  335. Also due to these changes some formatting defaults have changes so you have to check all your GridView and DetailView
  336. configuration and make sure the formatting is displayed correctly.
  337. The configuration for `asSize()` has changed. It now uses the configuration for the number formatting from intl
  338. and only the base is configured using `$sizeFormatBase`.
  339. The specification of the date and time formats is now using the ICU pattern format even if PHP intl extension is not installed.
  340. You can prefix a date format with `php:` to use the old format of the PHP `date()`-function.
  341. * The DateValidator has been refactored to use the same format as the Formatter class now (see previous change).
  342. When you use the DateValidator and did not specify a format it will now be what is configured in the formatter class instead of 'Y-m-d'.
  343. To get the old behavior of the DateValidator you have to set the format explicitly in your validation rule:
  344. ```php
  345. ['attributeName', 'date', 'format' => 'php:Y-m-d'],
  346. ```
  347. * `beforeValidate()`, `beforeValidateAll()`, `afterValidate()`, `afterValidateAll()`, `ajaxBeforeSend()` and `ajaxComplete()`
  348. are removed from `ActiveForm`. The same functionality is now achieved via JavaScript event mechanism like the following:
  349. ```js
  350. $('#myform').on('beforeValidate', function (event, messages, deferreds) {
  351. // called when the validation is triggered by submitting the form
  352. // return false if you want to cancel the validation for the whole form
  353. }).on('beforeValidateAttribute', function (event, attribute, messages, deferreds) {
  354. // before validating an attribute
  355. // return false if you want to cancel the validation for the attribute
  356. }).on('afterValidateAttribute', function (event, attribute, messages) {
  357. // ...
  358. }).on('afterValidate', function (event, messages) {
  359. // ...
  360. }).on('beforeSubmit', function () {
  361. // after all validations have passed
  362. // you can do ajax form submission here
  363. // return false if you want to stop form submission
  364. });
  365. ```
  366. * The signature of `View::registerJsFile()` and `View::registerCssFile()` has changed. The `$depends` and `$position`
  367. paramaters have been merged into `$options`. The new signatures are as follows:
  368. - `registerJsFile($url, $options = [], $key = null)`
  369. - `registerCssFile($url, $options = [], $key = null)`