The most important rule for creating URLs in your site is to always do so using the URL manager. The URL manager is a built-in application component named `urlManager`. This component is accessible from both web and console applications via
`\Yii::$app->urlManager`. The component makes availabe the two following URL creation methods:
`\Yii::$app->urlManager`. The component makes available the two following URL creation methods:
The following code style is used for Yii 2.x core and official extensions development. If you want to pull-request code into the core, consider using it. We aren't forcing you to use this code style for your application. Feel free to choose what suits you better.
The following code style is used for Yii 2.x core and official extensions development. If you want to pull-request code
into the core, consider using it. We aren't forcing you to use this code style for your application. Feel free to choose
what suits you better.
You can get a config for CodeSniffer here: https://github.com/yiisoft/yii2-coding-standards
1. Overview
-----------
Overall we're using [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
compatible style so everything that applies to
[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) is applied to our code
style as well.
- Files MUST use either `<?php` or `<?=` tags.
- There should be a newline at the end of file.
- Files MUST use only UTF-8 without BOM for PHP code.
- Code MUST use tabs for indenting, not spaces.
- Code MUST use 4 spaces for indenting, not tabs.
- Class names MUST be declared in `StudlyCaps`.
- Class constants MUST be declared in all upper case with underscore separators.
- Enh #497: Removed `\yii\log\Target::logUser` and added `\yii\log\Target::prefix` to support customizing message prefix (qiangxue)
- Enh #797: Added support for validating multiple columns by `UniqueValidator` and `ExistValidator` (qiangxue)
- Enh #802: Added support for retrieving sub-array element or child object property through `ArrayHelper::getValue()` (qiangxue, cebe)
- Enh #938: Added `yii\web\View::renderAjax()` and `yii\web\Controller::renderAjax()` (qiangxue)
...
...
@@ -146,6 +148,7 @@ Yii Framework 2 Change Log
- Enh #2729: Added `FilterValidator::skipOnArray` so that filters like `trim` will not fail for array inputs (qiangxue)
- Enh #2735: Added support for `DateTimeInterface` in `Formatter` (ivokund)
- Enh #2756: Added support for injecting custom `isEmpty` check for all validators (qiangxue)
- Enh #2775: Added `yii\base\Application::bootstrap` to support running bootstrap classes when starting an application (qiangxue)
- Enh: Added support for using arrays as option values for console commands (qiangxue)
- Enh: Added `favicon.ico` and `robots.txt` to default application templates (samdark)
- Enh: Added `Widget::autoIdPrefix` to support prefixing automatically generated widget IDs (qiangxue)
...
...
@@ -241,6 +244,7 @@ Yii Framework 2 Change Log
- Renamed `yii\web\User::returnUrlVar` to `returnUrlParam`
- Chg: Added `View::viewFile` and removed `ViewEvent::viewFile` (qiangxue)
- Chg: Changed `Controller::afterAction()`, `Module::afterAction()` and `ActionFilter::afterAction()` to pass `$result` by value instead of reference (qiangxue)
- Chg: `yii\base\Extension::init()` is renamed to `bootstrap()` (qiangxue)
'The file "{file}" is not an image.'=>'Tiedosto "{file}" ei ole kuva.',
'The file "{file}" is too big. Its size cannot exceed {limit, number} {limit, plural, one{byte} other{bytes}}.'=>'Tiedosto "{file}" on liian iso. Sen koko ei voi olla suurempi kuin {limit, number} {limit, plural, one{tavu} other{tavua}}.',
'The file "{file}" is too small. Its size cannot be smaller than {limit, number} {limit, plural, one{byte} other{bytes}}.'=>'Tiedosto "{file}" on liian pieni. Sen koko ei voi olla pienempi kuin {limit, number} {limit, plural, one{tavu} other{tavua}}.',
'The format of {attribute} is invalid.'=>'Attribuutin {attribute} formaatti on virheellinen.',
'The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.'=>'Kuva "{file}" on liian suuri. Korkeus ei voi olla suurempi kuin {limit, number} {limit, plural, one{pikseli} other{pikseliä}}.',
'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.'=>'Kuva "{file}" on liian suuri. Leveys ei voi olla suurempi kuin {limit, number} {limit, plural, one{pikseli} other{pikseliä}}.',
'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.'=>'Kuva "{file}" on liian pieni. Korkeus ei voi olla pienempi kuin {limit, number} {limit, plural, one{pikseli} other{pikseliä}}.',
'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.'=>'Kuva "{file}" on liian pieni. Leveys ei voi olla pienempi kuin {limit, number} {limit, plural, one{pikseli} other{pikseliä}}.',
'The verification code is incorrect.'=>'Vahvistuskoodi on virheellinen.',
'You are not allowed to perform this action.'=>'Sinulla ei ole tarvittavia oikeuksia toiminnon suorittamiseen.',
'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.'=>'Voit lähettää enintään {limit, number} {limit, plural, one{tiedoston} other{tiedostoa}}.',
'the input value'=>'tuloarvo',
'{attribute} "{value}" has already been taken.'=>'{attribute} "{value}" on jo käytössä.',
'{attribute} cannot be blank.'=>'{attribute} ei voi olla tyhjä.',
'{attribute} is invalid.'=>'{attribute} on virheellinen.',
'{attribute} is not a valid URL.'=>'{attribute} on virheellinen URL.',
'{attribute} is not a valid email address.'=>'{attribute} on virheellinen sähköpostiosoite.',
'{attribute} must be "{requiredValue}".'=>'{attribute} täytyy olla "{requiredValue}".',
'{attribute} must be a number.'=>'{attribute} täytyy olla luku.',
'{attribute} must be a string.'=>'{attribute} täytyy olla merkkijono.',
'{attribute} must be an integer.'=>'{attribute} täytyy olla kokonaisluku.',
'{attribute} must be either "{true}" or "{false}".'=>'{attribute} täytyy olla joko {true} tai {false}.',
'{attribute} must be greater than "{compareValue}".'=>'{attribute} täytyy olla suurempi kuin "{compareValue}".',
'{attribute} must be greater than or equal to "{compareValue}".'=>'{attribute} täytyy olla suurempi tai yhtä suuri kuin "{compareValue}".',
'{attribute} must be less than "{compareValue}".'=>'{attribute} täytyy olla pienempi kuin "{compareValue}".',
'{attribute} must be less than or equal to "{compareValue}".'=>'{attribute} täytyy olla pienempi tai yhtä suuri kuin "{compareValue}".',
'{attribute} must be no greater than {max}.'=>'{attribute} ei saa olla suurempi kuin "{max}".',
'{attribute} must be no less than {min}.'=>'{attribute} ei saa olla pienempi kuin "{min}".',
'{attribute} must be repeated exactly.'=>'{attribute} täytyy toistaa täsmälleen.',
'{attribute} must not be equal to "{compareValue}".'=>'{attribute} ei saa olla yhtä suuri kuin "{compareValue}".',
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.'=>'{attribute} tulisi sisältää vähintään {min, number} {min, plural, one{merkki} other{merkkiä}}.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.'=>'{attribute} tulisi sisältää enintään {max, number} {max, plural, one{merkki} other{merkkiä}}.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.'=>'{attribute} tulisi sisältää {length, number} {length, plural, one{merkki} other{merkkiä}}.',
'{attribute} must be less than "{compareValue}".'=>'{attribute} moet minder zijn dan "{compareValue}".',
'{attribute} must be less than or equal to "{compareValue}".'=>'{attribute} moet minder dan of gelijk aan "{compareValue}" zijn.',
'{attribute} must be no greater than {max}.'=>'{attribute} mag niet groter zijn dan {max}.',
'{attribute} must be no less than {min}.'=>'{attribute} mag niet kleiner zijn dan {max}.',
'{attribute} must be no less than {min}.'=>'{attribute} mag niet kleiner zijn dan {min}.',
'{attribute} must be repeated exactly.'=>'{attribute} moet exact herhaald worden.',
'{attribute} must not be equal to "{compareValue}".'=>'{attribute} mag niet gelijk zijn aan "{compareValue}".',
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.'=>'{attribute} moet minstens {min, number} {min, plural, one{karakter} other{karakters}} bevatten.',
@@ -132,7 +132,7 @@ class ImageValidator extends FileValidator
$this->overHeight=Yii::t('yii','The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.');
}
if($this->wrongMimeType===null){
$this->wrongMimeType=Yii::t('yii','Only files with these mimeTypes are allowed: {mimeTypes}.');
$this->wrongMimeType=Yii::t('yii','Only files with these MIME types are allowed: {mimeTypes}.');