Commit b7e493fc by Carsten Brandt

Tabs to spaces to be consistent

``` vendor/bin/indent --spaces -r framework/ vendor/bin/indent --tabs -r . --pattern=*.json vendor/bin/indent --spaces -r . --pattern=*.md vendor/bin/indent --spaces -r . --pattern=yii.*.js vendor/bin/indent --spaces -r . --pattern=*.css ```
parent 175d1325
html, html,
body { body {
height: 100%; height: 100%;
} }
.wrap { .wrap {
min-height: 100%; min-height: 100%;
height: auto; height: auto;
margin: 0 auto -60px; margin: 0 auto -60px;
padding: 0 0 60px; padding: 0 0 60px;
} }
.wrap > .container { .wrap > .container {
...@@ -15,61 +15,61 @@ body { ...@@ -15,61 +15,61 @@ body {
} }
.footer { .footer {
height: 60px; height: 60px;
background-color: #f5f5f5; background-color: #f5f5f5;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
padding-top: 20px; padding-top: 20px;
} }
.jumbotron { .jumbotron {
text-align: center; text-align: center;
background-color: transparent; background-color: transparent;
} }
.jumbotron .btn { .jumbotron .btn {
font-size: 21px; font-size: 21px;
padding: 14px 24px; padding: 14px 24px;
} }
.not-set { .not-set {
color: #c55; color: #c55;
font-style: italic; font-style: italic;
} }
/* add sorting icons to gridview sort links */ /* add sorting icons to gridview sort links */
a.asc:after, a.desc:after { a.asc:after, a.desc:after {
position: relative; position: relative;
top: 1px; top: 1px;
display: inline-block; display: inline-block;
font-family: 'Glyphicons Halflings'; font-family: 'Glyphicons Halflings';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
line-height: 1; line-height: 1;
padding-left: 5px; padding-left: 5px;
} }
a.asc:after { a.asc:after {
content: /*"\e113"*/ "\e151"; content: /*"\e113"*/ "\e151";
} }
a.desc:after { a.desc:after {
content: /*"\e114"*/ "\e152"; content: /*"\e114"*/ "\e152";
} }
.sort-numerical a.asc:after { .sort-numerical a.asc:after {
content: "\e153"; content: "\e153";
} }
.sort-numerical a.desc:after { .sort-numerical a.desc:after {
content: "\e154"; content: "\e154";
} }
.sort-ordinal a.asc:after { .sort-ordinal a.asc:after {
content: "\e155"; content: "\e155";
} }
.sort-ordinal a.desc:after { .sort-ordinal a.desc:after {
content: "\e156"; content: "\e156";
} }
.grid-view th { .grid-view th {
...@@ -77,15 +77,15 @@ a.desc:after { ...@@ -77,15 +77,15 @@ a.desc:after {
} }
.hint-block { .hint-block {
display: block; display: block;
margin-top: 5px; margin-top: 5px;
color: #999; color: #999;
} }
.error-summary { .error-summary {
color: #a94442; color: #a94442;
background: #fdf7f7; background: #fdf7f7;
border-left: 3px solid #eed3d7; border-left: 3px solid #eed3d7;
padding: 10px 20px; padding: 10px 20px;
margin: 0 0 15px 0; margin: 0 0 15px 0;
} }
html, html,
body { body {
height: 100%; height: 100%;
} }
.wrap { .wrap {
min-height: 100%; min-height: 100%;
height: auto; height: auto;
margin: 0 auto -60px; margin: 0 auto -60px;
padding: 0 0 60px; padding: 0 0 60px;
} }
.wrap > .container { .wrap > .container {
...@@ -15,61 +15,61 @@ body { ...@@ -15,61 +15,61 @@ body {
} }
.footer { .footer {
height: 60px; height: 60px;
background-color: #f5f5f5; background-color: #f5f5f5;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
padding-top: 20px; padding-top: 20px;
} }
.jumbotron { .jumbotron {
text-align: center; text-align: center;
background-color: transparent; background-color: transparent;
} }
.jumbotron .btn { .jumbotron .btn {
font-size: 21px; font-size: 21px;
padding: 14px 24px; padding: 14px 24px;
} }
.not-set { .not-set {
color: #c55; color: #c55;
font-style: italic; font-style: italic;
} }
/* add sorting icons to gridview sort links */ /* add sorting icons to gridview sort links */
a.asc:after, a.desc:after { a.asc:after, a.desc:after {
position: relative; position: relative;
top: 1px; top: 1px;
display: inline-block; display: inline-block;
font-family: 'Glyphicons Halflings'; font-family: 'Glyphicons Halflings';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
line-height: 1; line-height: 1;
padding-left: 5px; padding-left: 5px;
} }
a.asc:after { a.asc:after {
content: /*"\e113"*/ "\e151"; content: /*"\e113"*/ "\e151";
} }
a.desc:after { a.desc:after {
content: /*"\e114"*/ "\e152"; content: /*"\e114"*/ "\e152";
} }
.sort-numerical a.asc:after { .sort-numerical a.asc:after {
content: "\e153"; content: "\e153";
} }
.sort-numerical a.desc:after { .sort-numerical a.desc:after {
content: "\e154"; content: "\e154";
} }
.sort-ordinal a.asc:after { .sort-ordinal a.asc:after {
content: "\e155"; content: "\e155";
} }
.sort-ordinal a.desc:after { .sort-ordinal a.desc:after {
content: "\e156"; content: "\e156";
} }
.grid-view th { .grid-view th {
...@@ -77,15 +77,15 @@ a.desc:after { ...@@ -77,15 +77,15 @@ a.desc:after {
} }
.hint-block { .hint-block {
display: block; display: block;
margin-top: 5px; margin-top: 5px;
color: #999; color: #999;
} }
.error-summary { .error-summary {
color: #a94442; color: #a94442;
background: #fdf7f7; background: #fdf7f7;
border-left: 3px solid #eed3d7; border-left: 3px solid #eed3d7;
padding: 10px 20px; padding: 10px 20px;
margin: 0 0 15px 0; margin: 0 0 15px 0;
} }
...@@ -75,11 +75,11 @@ Edit the file `config/db.php` with real data, for example: ...@@ -75,11 +75,11 @@ Edit the file `config/db.php` with real data, for example:
```php ```php
return [ return [
'class' => 'yii\db\Connection', 'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=yii2basic', 'dsn' => 'mysql:host=localhost;dbname=yii2basic',
'username' => 'root', 'username' => 'root',
'password' => '1234', 'password' => '1234',
'charset' => 'utf8', 'charset' => 'utf8',
]; ];
``` ```
......
html, html,
body { body {
height: 100%; height: 100%;
} }
.wrap { .wrap {
min-height: 100%; min-height: 100%;
height: auto; height: auto;
margin: 0 auto -60px; margin: 0 auto -60px;
padding: 0 0 60px; padding: 0 0 60px;
} }
.wrap > .container { .wrap > .container {
...@@ -15,61 +15,61 @@ body { ...@@ -15,61 +15,61 @@ body {
} }
.footer { .footer {
height: 60px; height: 60px;
background-color: #f5f5f5; background-color: #f5f5f5;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
padding-top: 20px; padding-top: 20px;
} }
.jumbotron { .jumbotron {
text-align: center; text-align: center;
background-color: transparent; background-color: transparent;
} }
.jumbotron .btn { .jumbotron .btn {
font-size: 21px; font-size: 21px;
padding: 14px 24px; padding: 14px 24px;
} }
.not-set { .not-set {
color: #c55; color: #c55;
font-style: italic; font-style: italic;
} }
/* add sorting icons to gridview sort links */ /* add sorting icons to gridview sort links */
a.asc:after, a.desc:after { a.asc:after, a.desc:after {
position: relative; position: relative;
top: 1px; top: 1px;
display: inline-block; display: inline-block;
font-family: 'Glyphicons Halflings'; font-family: 'Glyphicons Halflings';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
line-height: 1; line-height: 1;
padding-left: 5px; padding-left: 5px;
} }
a.asc:after { a.asc:after {
content: /*"\e113"*/ "\e151"; content: /*"\e113"*/ "\e151";
} }
a.desc:after { a.desc:after {
content: /*"\e114"*/ "\e152"; content: /*"\e114"*/ "\e152";
} }
.sort-numerical a.asc:after { .sort-numerical a.asc:after {
content: "\e153"; content: "\e153";
} }
.sort-numerical a.desc:after { .sort-numerical a.desc:after {
content: "\e154"; content: "\e154";
} }
.sort-ordinal a.asc:after { .sort-ordinal a.asc:after {
content: "\e155"; content: "\e155";
} }
.sort-ordinal a.desc:after { .sort-ordinal a.desc:after {
content: "\e156"; content: "\e156";
} }
.grid-view th { .grid-view th {
...@@ -77,15 +77,15 @@ a.desc:after { ...@@ -77,15 +77,15 @@ a.desc:after {
} }
.hint-block { .hint-block {
display: block; display: block;
margin-top: 5px; margin-top: 5px;
color: #999; color: #999;
} }
.error-summary { .error-summary {
color: #a94442; color: #a94442;
background: #fdf7f7; background: #fdf7f7;
border-left: 3px solid #eed3d7; border-left: 3px solid #eed3d7;
padding: 10px 20px; padding: 10px 20px;
margin: 0 0 15px 0; margin: 0 0 15px 0;
} }
...@@ -83,7 +83,8 @@ ...@@ -83,7 +83,8 @@
"twig/twig": "*", "twig/twig": "*",
"smarty/smarty": "*", "smarty/smarty": "*",
"imagine/imagine": "v0.5.0", "imagine/imagine": "v0.5.0",
"swiftmailer/swiftmailer": "*" "swiftmailer/swiftmailer": "*",
"cebe/indent": "*"
}, },
"suggest": { "suggest": {
"phpdocumentor/reflection": "required by yii2-apidoc extension", "phpdocumentor/reflection": "required by yii2-apidoc extension",
......
...@@ -52,11 +52,11 @@ connection `DSN` doesn't indicate uniquely what database type is being used. Tha ...@@ -52,11 +52,11 @@ connection `DSN` doesn't indicate uniquely what database type is being used. Tha
```php ```php
'db' => [ 'db' => [
'class' => 'yii\db\Connection', 'class' => 'yii\db\Connection',
'driverName' => 'mysql', 'driverName' => 'mysql',
'dsn' => 'odbc:Driver={MySQL};Server=localhost;Database=test', 'dsn' => 'odbc:Driver={MySQL};Server=localhost;Database=test',
'username' => 'root', 'username' => 'root',
'password' => '', 'password' => '',
], ],
``` ```
......
...@@ -293,8 +293,8 @@ $searchModel = new PostSearch(); ...@@ -293,8 +293,8 @@ $searchModel = new PostSearch();
$dataProvider = $searchModel->search($_GET); $dataProvider = $searchModel->search($_GET);
return $this->render('myview', [ return $this->render('myview', [
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'searchModel' => $searchModel, 'searchModel' => $searchModel,
]); ]);
``` ```
...@@ -303,7 +303,7 @@ And in the view you then assign the `$dataProvider` and `$searchModel` to the Gr ...@@ -303,7 +303,7 @@ And in the view you then assign the `$dataProvider` and `$searchModel` to the Gr
```php ```php
echo GridView::widget([ echo GridView::widget([
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'filterModel' => $searchModel, 'filterModel' => $searchModel,
]); ]);
``` ```
......
...@@ -149,14 +149,14 @@ life cycle: ...@@ -149,14 +149,14 @@ life cycle:
4. Initialize the application with [CApplication::init()] 4. Initialize the application with [CApplication::init()]
- Register application behaviors; - Register application behaviors;
- Load static application components; - Load static application components;
5. Raise an [onBeginRequest|CApplication::onBeginRequest] event; 5. Raise an [onBeginRequest|CApplication::onBeginRequest] event;
6. Process the user request: 6. Process the user request:
- Collect information about the request; - Collect information about the request;
- Create a controller; - Create a controller;
- Run the controller; - Run the controller;
7. Raise an [onEndRequest|CApplication::onEndRequest] event; 7. Raise an [onEndRequest|CApplication::onEndRequest] event;
...@@ -64,7 +64,7 @@ The term "class" refers to all classes and interfaces here. ...@@ -64,7 +64,7 @@ The term "class" refers to all classes and interfaces here.
*/ */
class MyClass extends \yii\Object implements MyInterface class MyClass extends \yii\Object implements MyInterface
{ {
// code // code
} }
``` ```
...@@ -77,8 +77,8 @@ For example: ...@@ -77,8 +77,8 @@ For example:
<?php <?php
class Foo class Foo
{ {
const VERSION = '1.0'; const VERSION = '1.0';
const DATE_APPROVED = '2012-06-01'; const DATE_APPROVED = '2012-06-01';
} }
``` ```
### 4.2. Properties ### 4.2. Properties
...@@ -101,9 +101,9 @@ For example: ...@@ -101,9 +101,9 @@ For example:
<?php <?php
class Foo class Foo
{ {
public $publicProp; public $publicProp;
protected $protectedProp; protected $protectedProp;
private $_privateProp; private $_privateProp;
} }
``` ```
...@@ -121,14 +121,14 @@ class Foo ...@@ -121,14 +121,14 @@ class Foo
*/ */
class Foo class Foo
{ {
/** /**
* Documentation * Documentation
*/ */
public function bar() public function bar()
{ {
// code // code
return $value; return $value;
} }
} }
~~~ ~~~
...@@ -150,8 +150,8 @@ Use the following format for associative arrays: ...@@ -150,8 +150,8 @@ Use the following format for associative arrays:
```php ```php
$config = [ $config = [
'name' => 'Yii', 'name' => 'Yii',
'options' => ['usePHP' => true], 'options' => ['usePHP' => true],
]; ];
``` ```
...@@ -161,8 +161,8 @@ Changing type of an existing variable is considered as a bad practice. Try not t ...@@ -161,8 +161,8 @@ Changing type of an existing variable is considered as a bad practice. Try not t
```php ```php
public function save(Transaction $transaction, $argument2 = 100) public function save(Transaction $transaction, $argument2 = 100)
{ {
$transaction = new Connection; // bad $transaction = new Connection; // bad
$argument2 = 200; // good $argument2 = 200; // good
} }
``` ```
...@@ -201,8 +201,8 @@ When string is long format is the following: ...@@ -201,8 +201,8 @@ When string is long format is the following:
```php ```php
$sql = "SELECT *" $sql = "SELECT *"
. "FROM `post` " . "FROM `post` "
. "WHERE `id` = 121 "; . "WHERE `id` = 121 ";
``` ```
### 5.3 arrays ### 5.3 arrays
...@@ -223,9 +223,9 @@ If there are too many elements for a single line: ...@@ -223,9 +223,9 @@ If there are too many elements for a single line:
```php ```php
$arr = [ $arr = [
3, 14, 15, 3, 14, 15,
92, 6, $test, 92, 6, $test,
'Yii', 'Framework', 'Yii', 'Framework',
]; ];
``` ```
...@@ -235,8 +235,8 @@ Use the following format for associative arrays: ...@@ -235,8 +235,8 @@ Use the following format for associative arrays:
```php ```php
$config = [ $config = [
'name' => 'Yii', 'name' => 'Yii',
'options' => ['usePHP' => true], 'options' => ['usePHP' => true],
]; ];
``` ```
...@@ -250,16 +250,16 @@ $config = [ ...@@ -250,16 +250,16 @@ $config = [
```php ```php
if ($event === null) { if ($event === null) {
return new Event(); return new Event();
} elseif ($event instanceof CoolEvent) { } elseif ($event instanceof CoolEvent) {
return $event->instance(); return $event->instance();
} else { } else {
return null; return null;
} }
// the following is NOT allowed: // the following is NOT allowed:
if (!$model && null === $event) if (!$model && null === $event)
throw new Exception('test'); throw new Exception('test');
``` ```
#### switch #### switch
...@@ -268,18 +268,18 @@ Use the following formatting for switch: ...@@ -268,18 +268,18 @@ Use the following formatting for switch:
```php ```php
switch ($this->phpType) { switch ($this->phpType) {
case 'string': case 'string':
$a = (string)$value; $a = (string)$value;
break; break;
case 'integer': case 'integer':
case 'int': case 'int':
$a = (integer)$value; $a = (integer)$value;
break; break;
case 'boolean': case 'boolean':
$a = (boolean)$value; $a = (boolean)$value;
break; break;
default: default:
$a = null; $a = null;
} }
``` ```
...@@ -291,8 +291,8 @@ doIt(2, 3); ...@@ -291,8 +291,8 @@ doIt(2, 3);
doIt(['a' => 'b']); doIt(['a' => 'b']);
doIt('a', [ doIt('a', [
'a' => 'b', 'a' => 'b',
'c' => 'd', 'c' => 'd',
]); ]);
``` ```
...@@ -304,17 +304,17 @@ Note space between `function`/`use` tokens and open parenthesis: ...@@ -304,17 +304,17 @@ Note space between `function`/`use` tokens and open parenthesis:
// good // good
$n = 100; $n = 100;
$sum = array_reduce($numbers, function ($r, $x) use ($n) { $sum = array_reduce($numbers, function ($r, $x) use ($n) {
$this->doMagic(); $this->doMagic();
$r += $x * $n; $r += $x * $n;
return $r; return $r;
}); });
// bad // bad
$n = 100; $n = 100;
$mul = array_reduce($numbers, function($r, $x) use($n) { $mul = array_reduce($numbers, function($r, $x) use($n) {
$this->doMagic(); $this->doMagic();
$r *= $x * $n; $r *= $x * $n;
return $r; return $r;
}); });
``` ```
...@@ -336,17 +336,17 @@ Documentation ...@@ -336,17 +336,17 @@ Documentation
in `@return`. Here is an example: in `@return`. Here is an example:
```php ```php
<?php <?php
/** /**
* Returns the errors for all attribute or a single attribute. * Returns the errors for all attribute or a single attribute.
* @param string $attribute attribute name. Use null to retrieve errors for all attributes. * @param string $attribute attribute name. Use null to retrieve errors for all attributes.
* @property array An array of errors for all attributes. Empty array is returned if no error. * @property array An array of errors for all attributes. Empty array is returned if no error.
* The result is a two-dimensional array. See [[getErrors()]] for detailed description. * The result is a two-dimensional array. See [[getErrors()]] for detailed description.
* @return array errors for all attributes or the specified attribute. Empty array is returned if no error. * @return array errors for all attributes or the specified attribute. Empty array is returned if no error.
* Note that when returning errors for all attributes, the result is a two-dimensional array, like the following: * Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:
* ... * ...
*/ */
public function getErrors($attribute = null) public function getErrors($attribute = null)
``` ```
#### File #### File
...@@ -393,11 +393,11 @@ class Component extends \yii\base\Object ...@@ -393,11 +393,11 @@ class Component extends \yii\base\Object
*/ */
public function getEventHandlers($name) public function getEventHandlers($name)
{ {
if (!isset($this->_e[$name])) { if (!isset($this->_e[$name])) {
$this->_e[$name] = new Vector; $this->_e[$name] = new Vector;
} }
$this->ensureBehaviors(); $this->ensureBehaviors();
return $this->_e[$name]; return $this->_e[$name];
} }
``` ```
......
...@@ -26,26 +26,26 @@ $this->title = 'Posts'; ...@@ -26,26 +26,26 @@ $this->title = 'Posts';
?> ?>
<!-- Separate PHP blocks are preferred for foreach, for, if etc. --> <!-- Separate PHP blocks are preferred for foreach, for, if etc. -->
<?php foreach ($posts as $post): ?> <?php foreach ($posts as $post): ?>
<!-- Note indentation level here. --> <!-- Note indentation level here. -->
<h2><?= Html::encode($post['title']) ?></h2> <h2><?= Html::encode($post['title']) ?></h2>
<p><?= Html::encode($post['shortDescription']) ?></p> <p><?= Html::encode($post['shortDescription']) ?></p>
<!-- `endforeach;`, `endfor;`, `endif;`, etc. should be used instead of `}` in case multiple PHP blocks are used --> <!-- `endforeach;`, `endfor;`, `endif;`, etc. should be used instead of `}` in case multiple PHP blocks are used -->
<?php endforeach; ?> <?php endforeach; ?>
<!-- Widget declaration may or may not be exploded into multiple LOCs. --> <!-- Widget declaration may or may not be exploded into multiple LOCs. -->
<?php $form = ActiveForm::begin([ <?php $form = ActiveForm::begin([
'options' => ['id' => 'contact-message-form'], 'options' => ['id' => 'contact-message-form'],
'fieldConfig' => ['inputOptions' => ['class' => 'common-input']], 'fieldConfig' => ['inputOptions' => ['class' => 'common-input']],
]); ?> ]); ?>
<!-- Note indentation level here. --> <!-- Note indentation level here. -->
<?= $form->field($contactMessage, 'name')->textInput() ?> <?= $form->field($contactMessage, 'name')->textInput() ?>
<?= $form->field($contactMessage, 'email')->textInput() ?> <?= $form->field($contactMessage, 'email')->textInput() ?>
<?= $form->field($contactMessage, 'subject')->textInput() ?> <?= $form->field($contactMessage, 'subject')->textInput() ?>
<?= $form->field($contactMessage, 'body')->textArea(['rows' => 6]) ?> <?= $form->field($contactMessage, 'body')->textArea(['rows' => 6]) ?>
<div class="form-actions"> <div class="form-actions">
<?= Html::submitButton('Submit', ['class' => 'common-button']) ?> <?= Html::submitButton('Submit', ['class' => 'common-button']) ?>
</div> </div>
<!-- Ending widget call should have individual PHP tag. --> <!-- Ending widget call should have individual PHP tag. -->
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
<!-- Trailing newline character is mandatory. --> <!-- Trailing newline character is mandatory. -->
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"email": "mail@cebe.cc" "email": "mail@cebe.cc"
} }
], ],
"minimum-stability": "dev", "minimum-stability": "dev",
"require": { "require": {
"yiisoft/yii2": "*", "yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-bootstrap": "*",
......
...@@ -16,15 +16,15 @@ use yii\helpers\StringHelper; ...@@ -16,15 +16,15 @@ use yii\helpers\StringHelper;
class ApiIndexer extends Indexer class ApiIndexer extends Indexer
{ {
protected function generateFileInfo($file, $contents, $basePath, $baseUrl) protected function generateFileInfo($file, $contents, $basePath, $baseUrl)
{ {
// create file entry // create file entry
if (preg_match('~<h1>(.*?)</h1>~s', $contents, $matches)) { if (preg_match('~<h1>(.*?)</h1>~s', $contents, $matches)) {
$title = str_replace('&para;', '', strip_tags($matches[1])); $title = str_replace('&para;', '', strip_tags($matches[1]));
} elseif (preg_match('~<title>(.*?)</title>~s', $contents, $matches)) { } elseif (preg_match('~<title>(.*?)</title>~s', $contents, $matches)) {
$title = strip_tags($matches[1]); $title = strip_tags($matches[1]);
} else { } else {
$title = '<i>No title</i>'; $title = '<i>No title</i>';
} }
if (preg_match('~<div id="classDescription">\s*<strong>(.*?)</strong>~s', $contents, $matches)) { if (preg_match('~<div id="classDescription">\s*<strong>(.*?)</strong>~s', $contents, $matches)) {
$description = strip_tags($matches[1]); $description = strip_tags($matches[1]);
...@@ -37,24 +37,24 @@ class ApiIndexer extends Indexer ...@@ -37,24 +37,24 @@ class ApiIndexer extends Indexer
$description = ''; $description = '';
} }
return [ return [
'u' => $baseUrl . str_replace('\\', '/', substr($file, strlen(rtrim($basePath, '\\/')))), 'u' => $baseUrl . str_replace('\\', '/', substr($file, strlen(rtrim($basePath, '\\/')))),
't' => $title, 't' => $title,
'd' => $description, 'd' => $description,
]; ];
} }
/** /**
* @return TokenizerInterface * @return TokenizerInterface
*/ */
public function getTokenizer() public function getTokenizer()
{ {
$tokenizer = parent::getTokenizer(); $tokenizer = parent::getTokenizer();
if ($tokenizer instanceof StandardTokenizer) { if ($tokenizer instanceof StandardTokenizer) {
// yii is part of every doc and makes weird search results // yii is part of every doc and makes weird search results
$tokenizer->stopWords[] = 'yii'; $tokenizer->stopWords[] = 'yii';
$tokenizer->stopWords = array_unique($tokenizer->stopWords); $tokenizer->stopWords = array_unique($tokenizer->stopWords);
} }
return $tokenizer; return $tokenizer;
} }
} }
\ No newline at end of file
...@@ -24,7 +24,7 @@ code { ...@@ -24,7 +24,7 @@ code {
} }
div.code { div.code {
display: none; display: none;
color: #000000; color: #000000;
background-color: #FFF5E6; background-color: #FFF5E6;
font-family: "courier new", "times new roman", monospace; font-family: "courier new", "times new roman", monospace;
...@@ -43,57 +43,57 @@ div.code { ...@@ -43,57 +43,57 @@ div.code {
} }
table.summaryTable { table.summaryTable {
background: #E6ECFF; background: #E6ECFF;
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
} }
table.summaryTable th, table.summaryTable td { table.summaryTable th, table.summaryTable td {
border: 1px #BFCFFF solid; border: 1px #BFCFFF solid;
padding: 0.2em; padding: 0.2em;
} }
table.summaryTable th { table.summaryTable th {
background: #CCD9FF; background: #CCD9FF;
text-align: left; text-align: left;
} }
#nav { #nav {
padding: 3px; padding: 3px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
border-top: 1px #BFCFFF solid; border-top: 1px #BFCFFF solid;
} }
#classDescription { #classDescription {
padding: 5px; padding: 5px;
margin: 10px 0 20px 0; margin: 10px 0 20px 0;
border-bottom: 1px solid #BFCFFF; border-bottom: 1px solid #BFCFFF;
} }
.detailHeader { .detailHeader {
font-weight: bold; font-weight: bold;
font-size: 12pt; font-size: 12pt;
margin: 30px 0 5px 0; margin: 30px 0 5px 0;
border-bottom: 1px solid #BFCFFF; border-bottom: 1px solid #BFCFFF;
} }
.detailHeaderTag { .detailHeaderTag {
font-weight: normal; font-weight: normal;
font-size: 10pt; font-size: 10pt;
} }
.paramNameCol { .paramNameCol {
width: 12%; width: 12%;
font-weight: bold; font-weight: bold;
} }
.paramTypeCol { .paramTypeCol {
width: 12%; width: 12%;
} }
.sourceCode { .sourceCode {
margin: 5px 0; margin: 5px 0;
padding:5px; padding:5px;
background:#FFF5E6; background:#FFF5E6;
} }
\ No newline at end of file
html, html,
body { body {
height: 100%; height: 100%;
} }
.guide-content, .api-content { .guide-content, .api-content {
max-width: 1250px; max-width: 1250px;
} }
.wrap { .wrap {
min-height: 100%; min-height: 100%;
height: auto; height: auto;
width: auto; width: auto;
margin: 60px 30px 0 30px; margin: 60px 30px 0 30px;
padding: 0; padding: 0;
} }
.footer { .footer {
height: 60px; height: 60px;
background-color: #f5f5f5; background-color: #f5f5f5;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
padding: 20px 30px; padding: 20px 30px;
} }
#navigation { #navigation {
margin-top: 20px; margin-top: 20px;
} }
.submenu a { .submenu a {
background: #f5f5f5; background: #f5f5f5;
border-radius: 0; border-radius: 0;
} }
.submenu a:hover, .submenu a:active, .submenu a:hover, .submenu a:active,
.submenu a.active, .submenu a.active:hover, .submenu a.active:active { .submenu a.active, .submenu a.active:hover, .submenu a.active:active {
background: #44b5f6; background: #44b5f6;
border-color: #44b5f6; border-color: #44b5f6;
border-radius: 0; border-radius: 0;
color: #fff; color: #fff;
} }
.signature, .table-striped > tbody > tr > td.signature { .signature, .table-striped > tbody > tr > td.signature {
margin: 10px 0 10px 0; margin: 10px 0 10px 0;
padding: 8px; padding: 8px;
color: #000000; color: #000000;
background: rgba(230, 236, 255, 0.81); background: rgba(230, 236, 255, 0.81);
border: 1px rgba(191, 207, 255, 0.81) solid; border: 1px rgba(191, 207, 255, 0.81) solid;
font-family: "courier new", "times new roman", monospace; font-family: "courier new", "times new roman", monospace;
line-height: 1.3em; line-height: 1.3em;
white-space: pre-line; white-space: pre-line;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
} }
blockquote { blockquote {
font-size: 14px; font-size: 14px;
} }
td p { td p {
margin: 0; margin: 0;
} }
table.detail-table .param-name-col { width: 15%; min-width: 100px; } table.detail-table .param-name-col { width: 15%; min-width: 100px; }
...@@ -73,41 +73,41 @@ table.summary-table .col-event { width: 20%; } ...@@ -73,41 +73,41 @@ table.summary-table .col-event { width: 20%; }
table.summary-table .col-defined { width: 15%; } table.summary-table .col-defined { width: 15%; }
.detail-header { .detail-header {
margin-top: 30px; margin-top: 30px;
} }
.doc-description { .doc-description {
border-left: solid 1px #ddd; border-left: solid 1px #ddd;
border-right: solid 1px #ddd; border-right: solid 1px #ddd;
padding: 10px 8px; padding: 10px 8px;
margin: 0; margin: 0;
} }
.event-doc .doc-description { .event-doc .doc-description {
border-bottom: solid 1px #ddd; border-bottom: solid 1px #ddd;
} }
.doc-description p:last-child { .doc-description p:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.tool-link { .tool-link {
float: right; float: right;
color: #ddd; color: #ddd;
margin: 0 8px; margin: 0 8px;
} }
.icon-hash:before { .icon-hash:before {
content: '#'; content: '#';
font-size: 32px; font-size: 32px;
font-weight: bold; font-weight: bold;
/*top: -10px;*/ /*top: -10px;*/
line-height: 0.5; line-height: 0.5;
} }
.tool-link:hover { .tool-link:hover {
color: #bbb; color: #bbb;
text-decoration: none; text-decoration: none;
} }
......
...@@ -182,23 +182,23 @@ use yii\authclient\OAuth2; ...@@ -182,23 +182,23 @@ use yii\authclient\OAuth2;
class MyAuthClient extends OAuth2 class MyAuthClient extends OAuth2
{ {
protected function defaultName() protected function defaultName()
{ {
return 'my_auth_client'; return 'my_auth_client';
} }
protected function defaultTitle() protected function defaultTitle()
{ {
return 'My Auth Client'; return 'My Auth Client';
} }
protected function defaultViewOptions() protected function defaultViewOptions()
{ {
return [ return [
'popupWidth' => 800, 'popupWidth' => 800,
'popupHeight' => 500, 'popupHeight' => 500,
]; ];
} }
} }
``` ```
...@@ -215,16 +215,16 @@ use yii\authclient\OpenId; ...@@ -215,16 +215,16 @@ use yii\authclient\OpenId;
class MyAuthClient extends OpenId class MyAuthClient extends OpenId
{ {
public $authUrl = 'https://www.my.com/openid/'; public $authUrl = 'https://www.my.com/openid/';
public $requiredAttributes = [ public $requiredAttributes = [
'contact/email', 'contact/email',
]; ];
public $optionalAttributes = [ public $optionalAttributes = [
'namePerson/first', 'namePerson/first',
'namePerson/last', 'namePerson/last',
]; ];
} }
``` ```
...@@ -243,16 +243,16 @@ use yii\authclient\OAuth2; ...@@ -243,16 +243,16 @@ use yii\authclient\OAuth2;
class MyAuthClient extends OAuth2 class MyAuthClient extends OAuth2
{ {
public $authUrl = 'https://www.my.com/oauth2/auth'; public $authUrl = 'https://www.my.com/oauth2/auth';
public $tokenUrl = 'https://www.my.com/oauth2/token'; public $tokenUrl = 'https://www.my.com/oauth2/token';
public $apiBaseUrl = 'https://www.my.com/apis/oauth2/v1'; public $apiBaseUrl = 'https://www.my.com/apis/oauth2/v1';
protected function initUserAttributes() protected function initUserAttributes()
{ {
return $this->api('userinfo', 'GET'); return $this->api('userinfo', 'GET');
} }
} }
``` ```
...@@ -277,18 +277,18 @@ use yii\authclient\OAuth1; ...@@ -277,18 +277,18 @@ use yii\authclient\OAuth1;
class MyAuthClient extends OAuth1 class MyAuthClient extends OAuth1
{ {
public $authUrl = 'https://www.my.com/oauth/auth'; public $authUrl = 'https://www.my.com/oauth/auth';
public $requestTokenUrl = 'https://www.my.com/oauth/request_token'; public $requestTokenUrl = 'https://www.my.com/oauth/request_token';
public $accessTokenUrl = 'https://www.my.com/oauth/access_token'; public $accessTokenUrl = 'https://www.my.com/oauth/access_token';
public $apiBaseUrl = 'https://www.my.com/apis/oauth/v1'; public $apiBaseUrl = 'https://www.my.com/apis/oauth/v1';
protected function initUserAttributes() protected function initUserAttributes()
{ {
return $this->api('userinfo', 'GET'); return $this->api('userinfo', 'GET');
} }
} }
``` ```
......
{ {
"name": "yiisoft/yii2-bootstrap", "name": "yiisoft/yii2-bootstrap",
"description": "The Twitter Bootstrap extension for the Yii framework", "description": "The Twitter Bootstrap extension for the Yii framework",
"keywords": ["yii2", "bootstrap"], "keywords": ["yii2", "bootstrap"],
"type": "yii2-extension", "type": "yii2-extension",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"support": { "support": {
"issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Abootstrap", "issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Abootstrap",
"forum": "http://www.yiiframework.com/forum/", "forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/", "wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii", "irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2" "source": "https://github.com/yiisoft/yii2"
}, },
"authors": [ "authors": [
{ {
"name": "Qiang Xue", "name": "Qiang Xue",
"email": "qiang.xue@gmail.com" "email": "qiang.xue@gmail.com"
} }
], ],
"require": { "require": {
"yiisoft/yii2": "*", "yiisoft/yii2": "*",
"twbs/bootstrap": "3.1.* | 3.0.*" "twbs/bootstrap": "3.1.* | 3.0.*"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"yii\\bootstrap\\": "" "yii\\bootstrap\\": ""
} }
} }
} }
...@@ -69,7 +69,7 @@ use Codeception\Event\TestEvent; ...@@ -69,7 +69,7 @@ use Codeception\Event\TestEvent;
public function testSomething() public function testSomething()
{ {
$this->fire('myevent', new TestEvent($this)); $this->fire('myevent', new TestEvent($this));
} }
``` ```
this event can be catched in modules and helpers. If your test is in the group, then event name will be followed by the groupname, this event can be catched in modules and helpers. If your test is in the group, then event name will be followed by the groupname,
...@@ -84,15 +84,15 @@ Execution of special tests methods is (for example on ```UserTest``` class): ...@@ -84,15 +84,15 @@ Execution of special tests methods is (for example on ```UserTest``` class):
``` ```
tests\unit\models\UserTest::setUpBeforeClass(); tests\unit\models\UserTest::setUpBeforeClass();
tests\unit\models\UserTest::_before(); tests\unit\models\UserTest::_before();
tests\unit\models\UserTest::setUp(); tests\unit\models\UserTest::setUp();
tests\unit\models\UserTest::testSomething(); tests\unit\models\UserTest::testSomething();
tests\unit\models\UserTest::tearDown(); tests\unit\models\UserTest::tearDown();
tests\unit\models\UserTest::_after(); tests\unit\models\UserTest::_after();
tests\unit\models\UserTest::tearDownAfterClass(); tests\unit\models\UserTest::tearDownAfterClass();
``` ```
...@@ -109,8 +109,8 @@ You may need to specify different configuration files per test cases, to do this ...@@ -109,8 +109,8 @@ You may need to specify different configuration files per test cases, to do this
SomeConsoleTest extends \yii\codeception\TestCase SomeConsoleTest extends \yii\codeception\TestCase
{ {
// this is the config file to load as application config // this is the config file to load as application config
public $appConfig = '@app/path/to/my/custom/config/for/test.php'; public $appConfig = '@app/path/to/my/custom/config/for/test.php';
} }
``` ```
...@@ -120,14 +120,14 @@ application class in the config, for example for testing console commands or fea ...@@ -120,14 +120,14 @@ application class in the config, for example for testing console commands or fea
```php ```php
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../config/console.php'), require(__DIR__ . '/../../config/console.php'),
require(__DIR__ . '/../_config.php'), require(__DIR__ . '/../_config.php'),
[ [
'class' => 'yii\console\Application', 'class' => 'yii\console\Application',
'components' => [ 'components' => [
//override console components if needed //override console components if needed
], ],
] ]
); );
``` ```
...@@ -139,7 +139,7 @@ use \yii\codeception\TestCase; ...@@ -139,7 +139,7 @@ use \yii\codeception\TestCase;
class ConsoleTestCase extends TestCase class ConsoleTestCase extends TestCase
{ {
public $appConfig = '@tests/unit/_console.php'; public $appConfig = '@tests/unit/_console.php';
} }
``` ```
...@@ -160,15 +160,15 @@ use Yii; ...@@ -160,15 +160,15 @@ use Yii;
class MailTest extends TestCase class MailTest extends TestCase
{ {
protected function setUp() protected function setUp()
{ {
// don't forget to call parent method that will setup Yii application // don't forget to call parent method that will setup Yii application
parent::setUp(); parent::setUp();
Yii::$app->mail->fileTransportCallback = function ($mailer, $message) { Yii::$app->mail->fileTransportCallback = function ($mailer, $message) {
return 'testing_message.eml'; return 'testing_message.eml';
}; };
} }
} }
``` ```
...@@ -186,29 +186,29 @@ use \yii\codeception\TestCase; ...@@ -186,29 +186,29 @@ use \yii\codeception\TestCase;
class SomeMyTest extends TestCase class SomeMyTest extends TestCase
{ {
public function testOne() public function testOne()
{ {
... ...
} }
public function testTwo() public function testTwo()
{ {
$this->mockApplication([ $this->mockApplication([
'language' => 'ru-RU', 'language' => 'ru-RU',
'components' => [ 'components' => [
'db' => [ 'db' => [
//your custom configuration here //your custom configuration here
], ],
], ],
]); ]);
//your expectations and assertions goes here //your expectations and assertions goes here
} }
public function testThree() public function testThree()
{ {
... ...
} }
} }
``` ```
...@@ -226,12 +226,12 @@ use Codeception\Util\Debug; ...@@ -226,12 +226,12 @@ use Codeception\Util\Debug;
SomeDebugTest extends \yii\codeception\TestCase SomeDebugTest extends \yii\codeception\TestCase
{ {
public function testSmth() public function testSmth()
{ {
Debug::debug('some string'); Debug::debug('some string');
Debug::debug($someArray); Debug::debug($someArray);
Debug::debug($someObject); Debug::debug($someObject);
} }
} }
``` ```
......
...@@ -13,11 +13,11 @@ like the following: ...@@ -13,11 +13,11 @@ like the following:
```json ```json
{ {
"type": "yii2-extension", "type": "yii2-extension",
"require": { "require": {
"yiisoft/yii2": "*" "yiisoft/yii2": "*"
}, },
... ...
} }
``` ```
...@@ -26,11 +26,11 @@ the Yii 2 application is responding to a request. For example, ...@@ -26,11 +26,11 @@ the Yii 2 application is responding to a request. For example,
```json ```json
{ {
"type": "yii2-extension", "type": "yii2-extension",
..., ...,
"extra": { "extra": {
"bootstrap": "yii\\jui\\Extension" "bootstrap": "yii\\jui\\Extension"
} }
} }
``` ```
...@@ -42,22 +42,22 @@ For example, ...@@ -42,22 +42,22 @@ For example,
```json ```json
{ {
"name": "yiisoft/yii2-app-basic", "name": "yiisoft/yii2-app-basic",
"type": "project", "type": "project",
... ...
"scripts": { "scripts": {
"post-create-project-cmd": [ "post-create-project-cmd": [
"yii\\composer\\Installer::setPermission" "yii\\composer\\Installer::setPermission"
] ]
}, },
"extra": { "extra": {
"writable": [ "writable": [
"runtime", "runtime",
"web/assets" "web/assets"
], ],
"executable": [ "executable": [
"yii" "yii"
] ]
} }
} }
``` ```
span.indent { span.indent {
color: #ccc; color: #ccc;
} }
ul.trace { ul.trace {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
margin: 2px 0 0 0; margin: 2px 0 0 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
white-space: normal; white-space: normal;
} }
.callout-danger { .callout-danger {
background-color: #fcf2f2; background-color: #fcf2f2;
border-color: #dFb5b4; border-color: #dFb5b4;
} }
.callout { .callout {
margin: 0 0 10px 0; margin: 0 0 10px 0;
padding: 5px; padding: 5px;
} }
.list-group .glyphicon { .list-group .glyphicon {
float: right; float: right;
} }
td, th { td, th {
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
} }
.request-table td { .request-table td {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
word-break: break-all; word-break: break-all;
} }
.config-php-info-table td.v { .config-php-info-table td.v {
word-break: break-all; word-break: break-all;
} }
.not-set { .not-set {
color: #c55; color: #c55;
font-style: italic; font-style: italic;
} }
.detail-grid-view th { .detail-grid-view th {
...@@ -49,47 +49,47 @@ td, th { ...@@ -49,47 +49,47 @@ td, th {
/* add sorting icons to gridview sort links */ /* add sorting icons to gridview sort links */
a.asc:after, a.desc:after { a.asc:after, a.desc:after {
position: relative; position: relative;
top: 1px; top: 1px;
display: inline-block; display: inline-block;
font-family: 'Glyphicons Halflings'; font-family: 'Glyphicons Halflings';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
line-height: 1; line-height: 1;
padding-left: 5px; padding-left: 5px;
} }
a.asc:after { a.asc:after {
content: /*"\e113"*/ "\e151"; content: /*"\e113"*/ "\e151";
} }
a.desc:after { a.desc:after {
content: /*"\e114"*/ "\e152"; content: /*"\e114"*/ "\e152";
} }
.sort-numerical a.asc:after { .sort-numerical a.asc:after {
content: "\e153"; content: "\e153";
} }
.sort-numerical a.desc:after { .sort-numerical a.desc:after {
content: "\e154"; content: "\e154";
} }
.sort-ordinal a.asc:after { .sort-ordinal a.asc:after {
content: "\e155"; content: "\e155";
} }
.sort-ordinal a.desc:after { .sort-ordinal a.desc:after {
content: "\e156"; content: "\e156";
} }
.mail-sorter { .mail-sorter {
margin-top: 7px; margin-top: 7px;
} }
.mail-sorter li { .mail-sorter li {
list-style: none; list-style: none;
float: left; float: left;
width: 12%; width: 12%;
font-weight: bold; font-weight: bold;
} }
...@@ -9,8 +9,8 @@ To use this extension, you have to configure the Connection class in your applic ...@@ -9,8 +9,8 @@ To use this extension, you have to configure the Connection class in your applic
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
'elasticsearch' => [ 'elasticsearch' => [
'class' => 'yii\elasticsearch\Connection', 'class' => 'yii\elasticsearch\Connection',
'nodes' => [ 'nodes' => [
...@@ -18,7 +18,7 @@ return [ ...@@ -18,7 +18,7 @@ return [
// configure more hosts if you have a cluster // configure more hosts if you have a cluster
], ],
], ],
] ]
]; ];
``` ```
...@@ -152,11 +152,11 @@ $result = Article::find()->query(["field" => ["title" => "yii"]])->all(); // art ...@@ -152,11 +152,11 @@ $result = Article::find()->query(["field" => ["title" => "yii"]])->all(); // art
// http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-flt-query.html // http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-flt-query.html
$query = Article::find()->query([ $query = Article::find()->query([
"fuzzy_like_this" => [ "fuzzy_like_this" => [
"fields" => ["title", "description"], "fields" => ["title", "description"],
"like_text" => "This query will return articles that are similar to this text :-)", "like_text" => "This query will return articles that are similar to this text :-)",
"max_query_terms" : 12 "max_query_terms" : 12
] ]
]); ]);
$query->all(); // gives you all the documents $query->all(); // gives you all the documents
...@@ -179,19 +179,19 @@ Add the following to you application config to enable it (if you already have th ...@@ -179,19 +179,19 @@ Add the following to you application config to enable it (if you already have th
enabled, it is sufficient to just add the panels configuration): enabled, it is sufficient to just add the panels configuration):
```php ```php
// ... // ...
'bootstrap' => ['debug'], 'bootstrap' => ['debug'],
'modules' => [ 'modules' => [
'debug' => [ 'debug' => [
'class' => 'yii\\debug\\Module', 'class' => 'yii\\debug\\Module',
'panels' => [ 'panels' => [
'elasticsearch' => [ 'elasticsearch' => [
'class' => 'yii\\elasticsearch\\DebugPanel', 'class' => 'yii\\elasticsearch\\DebugPanel',
], ],
], ],
], ],
], ],
// ... // ...
``` ```
![elasticsearch DebugPanel](images/README-debug.png) ![elasticsearch DebugPanel](images/README-debug.png)
......
...@@ -31,9 +31,9 @@ To use this extension, simply add the following code in your application config ...@@ -31,9 +31,9 @@ To use this extension, simply add the following code in your application config
```php ```php
'controllerMap' => [ 'controllerMap' => [
'fixture' => [ 'fixture' => [
'class' => 'yii\faker\FixtureController', 'class' => 'yii\faker\FixtureController',
], ],
], ],
``` ```
Set valid ```test``` alias in your console config, for example for ```basic``` application template, this should be added Set valid ```test``` alias in your console config, for example for ```basic``` application template, this should be added
...@@ -44,17 +44,17 @@ generate fixtures template files, according to the given format: ...@@ -44,17 +44,17 @@ generate fixtures template files, according to the given format:
```php ```php
//users.php file under template path (by default @tests/unit/templates/fixtures) //users.php file under template path (by default @tests/unit/templates/fixtures)
return [ return [
[ [
'table_column0' => 'faker_formatter', 'table_column0' => 'faker_formatter',
... ...
'table_columnN' => 'other_faker_formatter' 'table_columnN' => 'other_faker_formatter'
'body' => function ($fixture, $faker, $index) { 'body' => function ($fixture, $faker, $index) {
//set needed fixture fields based on different conditions //set needed fixture fields based on different conditions
$fixture['body'] = $faker->sentence(7,true); //generate sentence exact with 7 words. $fixture['body'] = $faker->sentence(7,true); //generate sentence exact with 7 words.
return $fixture; return $fixture;
} }
], ],
]; ];
``` ```
...@@ -72,17 +72,17 @@ Another example of valid template: ...@@ -72,17 +72,17 @@ Another example of valid template:
use yii\helpers\Security; use yii\helpers\Security;
return [ return [
'name' => 'firstName', 'name' => 'firstName',
'phone' => 'phoneNumber', 'phone' => 'phoneNumber',
'city' => 'city', 'city' => 'city',
'password' => function ($fixture, $faker, $index) { 'password' => function ($fixture, $faker, $index) {
$fixture['password'] = Security::generatePasswordHash('password_' . $index); $fixture['password'] = Security::generatePasswordHash('password_' . $index);
return $fixture; return $fixture;
}, },
'auth_key' => function ($fixture, $faker, $index) { 'auth_key' => function ($fixture, $faker, $index) {
$fixture['auth_key'] = Security::generateRandomKey(); $fixture['auth_key'] = Security::generateRandomKey();
return $fixture; return $fixture;
}, },
]; ];
``` ```
...@@ -135,16 +135,16 @@ After you created custom provider, for example: ...@@ -135,16 +135,16 @@ After you created custom provider, for example:
```php ```php
class Book extends \Faker\Provider\Base class Book extends \Faker\Provider\Base
{ {
public function title($nbWords = 5) public function title($nbWords = 5)
{ {
$sentence = $this->generator->sentence($nbWords); $sentence = $this->generator->sentence($nbWords);
return mb_substr($sentence, 0, mb_strlen($sentence) - 1); return mb_substr($sentence, 0, mb_strlen($sentence) - 1);
} }
public function ISBN() public function ISBN()
{ {
return $this->generator->randomNumber(13); return $this->generator->randomNumber(13);
} }
} }
``` ```
...@@ -153,11 +153,11 @@ You can use it by adding it to the ```$providers``` property of the current comm ...@@ -153,11 +153,11 @@ You can use it by adding it to the ```$providers``` property of the current comm
```php ```php
'controllerMap' => [ 'controllerMap' => [
'fixture' => [ 'fixture' => [
'class' => 'yii\faker\FixtureController', 'class' => 'yii\faker\FixtureController',
'providers' => [ 'providers' => [
'app\tests\unit\faker\providers\Book', 'app\tests\unit\faker\providers\Book',
], ],
], ],
] ]
``` ```
body { body {
padding-top: 70px; padding-top: 70px;
} }
.footer { .footer {
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
margin-top: 30px; margin-top: 30px;
padding: 15px 0 30px; padding: 15px 0 30px;
} }
.jumbotron { .jumbotron {
text-align: center; text-align: center;
background-color: transparent; background-color: transparent;
} }
.jumbotron .btn { .jumbotron .btn {
font-size: 21px; font-size: 21px;
padding: 14px 24px; padding: 14px 24px;
} }
.navbar-brand { .navbar-brand {
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
.default-index .generator { .default-index .generator {
min-height: 200px; min-height: 200px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.list-group .glyphicon { .list-group .glyphicon {
float: right; float: right;
} }
.popover { .popover {
max-width: 400px; max-width: 400px;
width: 400px; width: 400px;
} }
.hint-block { .hint-block {
display: none; display: none;
} }
.error-summary { .error-summary {
color: #a94442; color: #a94442;
background: #fdf7f7; background: #fdf7f7;
border-left: 3px solid #eed3d7; border-left: 3px solid #eed3d7;
padding: 10px 20px; padding: 10px 20px;
margin: 0 0 15px 0; margin: 0 0 15px 0;
} }
.default-view .sticky-value { .default-view .sticky-value {
padding: 6px 12px; padding: 6px 12px;
background: lightyellow; background: lightyellow;
white-space: pre; white-space: pre;
word-wrap: break-word; word-wrap: break-word;
} }
.default-view .form-group label.help { .default-view .form-group label.help {
border-bottom: 1px dashed #888; border-bottom: 1px dashed #888;
cursor: help; cursor: help;
} }
.default-view .modal-dialog { .default-view .modal-dialog {
width: 800px; width: 800px;
} }
.default-view .modal-dialog .error { .default-view .modal-dialog .error {
color: #d9534f; color: #d9534f;
} }
.default-view .modal-dialog .content { .default-view .modal-dialog .content {
background: #fafafa; background: #fafafa;
border-left: #eee 5px solid; border-left: #eee 5px solid;
padding: 5px 10px; padding: 5px 10px;
overflow: auto; overflow: auto;
} }
.default-view .modal-dialog code { .default-view .modal-dialog code {
background: transparent; background: transparent;
} }
.default-view-files table .action { .default-view-files table .action {
width: 100px; width: 100px;
} }
.default-view-files table .check { .default-view-files table .check {
width: 25px; width: 25px;
text-align: center; text-align: center;
} }
.default-view-results pre { .default-view-results pre {
overflow: auto; overflow: auto;
background-color: #333; background-color: #333;
max-height: 300px; max-height: 300px;
color: white; color: white;
padding: 10px; padding: 10px;
border-radius: 0; border-radius: 0;
white-space: nowrap; white-space: nowrap;
} }
.default-view-results pre .error { .default-view-results pre .error {
background: #FFE0E1; background: #FFE0E1;
color: black; color: black;
padding: 1px; padding: 1px;
} }
.default-view-results .alert pre { .default-view-results .alert pre {
background: white; background: white;
} }
.default-diff pre { .default-diff pre {
padding: 0; padding: 0;
margin: 0; margin: 0;
background: transparent; background: transparent;
border: none; border: none;
} }
.default-diff pre del { .default-diff pre del {
background: pink; background: pink;
} }
.default-diff pre ins { .default-diff pre ins {
background: lightgreen; background: lightgreen;
text-decoration: none; text-decoration: none;
} }
.Differences { .Differences {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
empty-cells: show; empty-cells: show;
} }
.Differences thead { .Differences thead {
display: none; display: none;
} }
.Differences tbody th { .Differences tbody th {
text-align: right; text-align: right;
background: #FAFAFA; background: #FAFAFA;
padding: 1px 2px; padding: 1px 2px;
border-right: 1px solid #eee; border-right: 1px solid #eee;
vertical-align: top; vertical-align: top;
font-size: 13px; font-size: 13px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;
font-weight: normal; font-weight: normal;
color: #999; color: #999;
width: 5px; width: 5px;
} }
.Differences td { .Differences td {
padding: 1px 2px; padding: 1px 2px;
font-size: 13px; font-size: 13px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;
} }
.DifferencesSideBySide .ChangeInsert td.Left { .DifferencesSideBySide .ChangeInsert td.Left {
background: #dfd; background: #dfd;
} }
.DifferencesSideBySide .ChangeInsert td.Right { .DifferencesSideBySide .ChangeInsert td.Right {
background: #cfc; background: #cfc;
} }
.DifferencesSideBySide .ChangeDelete td.Left { .DifferencesSideBySide .ChangeDelete td.Left {
background: #f88; background: #f88;
} }
.DifferencesSideBySide .ChangeDelete td.Right { .DifferencesSideBySide .ChangeDelete td.Right {
background: #faa; background: #faa;
} }
.DifferencesSideBySide .ChangeReplace .Left { .DifferencesSideBySide .ChangeReplace .Left {
background: #fe9; background: #fe9;
} }
.DifferencesSideBySide .ChangeReplace .Right { .DifferencesSideBySide .ChangeReplace .Right {
background: #fd8; background: #fd8;
} }
.Differences ins, .Differences del { .Differences ins, .Differences del {
text-decoration: none; text-decoration: none;
} }
.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { .DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del {
background: #fc0; background: #fc0;
} }
.Differences .Skipped { .Differences .Skipped {
background: #f7f7f7; background: #f7f7f7;
} }
.DifferencesInline .ChangeReplace .Left, .DifferencesInline .ChangeReplace .Left,
.DifferencesInline .ChangeDelete .Left { .DifferencesInline .ChangeDelete .Left {
background: #fdd; background: #fdd;
} }
.DifferencesInline .ChangeReplace .Right, .DifferencesInline .ChangeReplace .Right,
.DifferencesInline .ChangeInsert .Right { .DifferencesInline .ChangeInsert .Right {
background: #dfd; background: #dfd;
} }
.DifferencesInline .ChangeReplace ins { .DifferencesInline .ChangeReplace ins {
background: #9e9; background: #9e9;
} }
.DifferencesInline .ChangeReplace del { .DifferencesInline .ChangeReplace del {
background: #e99; background: #e99;
} }
.DifferencesInline th[data-line-number]:before { .DifferencesInline th[data-line-number]:before {
content: attr(data-line-number); content: attr(data-line-number);
} }
/* additional styles for typeahead.js-bootstrap.css */ /* additional styles for typeahead.js-bootstrap.css */
......
{ {
"name": "<?= $generator->vendorName ?>/<?= $generator->packageName ?>", "name": "<?= $generator->vendorName ?>/<?= $generator->packageName ?>",
"description": "<?= $generator->description ?>", "description": "<?= $generator->description ?>",
"type": "<?= $generator->type ?>", "type": "<?= $generator->type ?>",
"keywords": <?= $generator->keywordsArrayJson ?>, "keywords": <?= $generator->keywordsArrayJson ?>,
"license": "<?= $generator->license ?>", "license": "<?= $generator->license ?>",
"authors": [ "authors": [
{ {
"name": "<?= $generator->authorName ?>", "name": "<?= $generator->authorName ?>",
"email": "<?= $generator->authorEmail ?>" "email": "<?= $generator->authorEmail ?>"
} }
], ],
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"<?= str_replace('\\','\\\\',$generator->namespace) ?>": "" "<?= str_replace('\\','\\\\',$generator->namespace) ?>": ""
} }
} }
} }
{ {
"name": "yiisoft/yii2-imagine", "name": "yiisoft/yii2-imagine",
"description": "The Imagine integration for the Yii framework", "description": "The Imagine integration for the Yii framework",
"keywords": ["yii2", "imagine", "image", "helper"], "keywords": ["yii2", "imagine", "image", "helper"],
"type": "yii2-extension", "type": "yii2-extension",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"support": { "support": {
"issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Aimagine", "issues": "https://github.com/yiisoft/yii2/issues?labels=ext%3Aimagine",
"forum": "http://www.yiiframework.com/forum/", "forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/", "wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii", "irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2" "source": "https://github.com/yiisoft/yii2"
}, },
"authors": [ "authors": [
{ {
"name": "Antonio Ramirez", "name": "Antonio Ramirez",
"email": "amigo.cobos@gmail.com" "email": "amigo.cobos@gmail.com"
} }
], ],
"require": { "require": {
"yiisoft/yii2": "*", "yiisoft/yii2": "*",
"imagine/imagine": "v0.5.0" "imagine/imagine": "v0.5.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"yii\\imagine\\": "" "yii\\imagine\\": ""
} }
} }
} }
...@@ -33,13 +33,13 @@ To use this extension, simply add the following code in your application configu ...@@ -33,13 +33,13 @@ To use this extension, simply add the following code in your application configu
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
'mongodb' => [ 'mongodb' => [
'class' => '\yii\mongodb\Connection', 'class' => '\yii\mongodb\Connection',
'dsn' => 'mongodb://developer:password@localhost:27017/mydatabase', 'dsn' => 'mongodb://developer:password@localhost:27017/mydatabase',
], ],
], ],
]; ];
``` ```
...@@ -59,8 +59,8 @@ use yii\mongodb\Query; ...@@ -59,8 +59,8 @@ use yii\mongodb\Query;
$query = new Query; $query = new Query;
// compose the query // compose the query
$query->select(['name', 'status']) $query->select(['name', 'status'])
->from('customer') ->from('customer')
->limit(10); ->limit(10);
// execute the query // execute the query
$rows = $query->all(); $rows = $query->all();
``` ```
...@@ -103,17 +103,17 @@ use yii\mongodb\Query; ...@@ -103,17 +103,17 @@ use yii\mongodb\Query;
class ItemController extends Controller class ItemController extends Controller
{ {
/** /**
* @param string $id MongoId string (not object) * @param string $id MongoId string (not object)
*/ */
public function actionUpdate($id) public function actionUpdate($id)
{ {
$query = new Query; $query = new Query;
$row = $query->from('item') $row = $query->from('item')
where(['_id' => $id]) // implicit typecast to [[\MongoId]] where(['_id' => $id]) // implicit typecast to [[\MongoId]]
->one(); ->one();
... ...
} }
} }
``` ```
...@@ -133,21 +133,21 @@ use yii\mongodb\ActiveRecord; ...@@ -133,21 +133,21 @@ use yii\mongodb\ActiveRecord;
class Customer extends ActiveRecord class Customer extends ActiveRecord
{ {
/** /**
* @return string the name of the index associated with this ActiveRecord class. * @return string the name of the index associated with this ActiveRecord class.
*/ */
public static function collectionName() public static function collectionName()
{ {
return 'customer'; return 'customer';
} }
/** /**
* @return array list of attribute names. * @return array list of attribute names.
*/ */
public function attributes() public function attributes()
{ {
return ['_id', 'name', 'email', 'address', 'status']; return ['_id', 'name', 'email', 'address', 'status'];
} }
} }
``` ```
...@@ -162,10 +162,10 @@ use yii\mongodb\Query; ...@@ -162,10 +162,10 @@ use yii\mongodb\Query;
$query = new Query; $query = new Query;
$query->from('customer')->where(['status' => 2]); $query->from('customer')->where(['status' => 2]);
$provider = new ActiveDataProvider([ $provider = new ActiveDataProvider([
'query' => $query, 'query' => $query,
'pagination' => [ 'pagination' => [
'pageSize' => 10, 'pageSize' => 10,
] ]
]); ]);
$models = $provider->getModels(); $models = $provider->getModels();
``` ```
...@@ -175,10 +175,10 @@ use yii\data\ActiveDataProvider; ...@@ -175,10 +175,10 @@ use yii\data\ActiveDataProvider;
use app\models\Customer; use app\models\Customer;
$provider = new ActiveDataProvider([ $provider = new ActiveDataProvider([
'query' => Customer::find(), 'query' => Customer::find(),
'pagination' => [ 'pagination' => [
'pageSize' => 10, 'pageSize' => 10,
] ]
]); ]);
$models = $provider->getModels(); $models = $provider->getModels();
``` ```
...@@ -193,11 +193,11 @@ For example: instead of: ...@@ -193,11 +193,11 @@ For example: instead of:
``` ```
{ {
content: "some content", content: "some content",
author: { author: {
name: author1, name: author1,
email: author1@domain.com email: author1@domain.com
} }
} }
``` ```
...@@ -205,9 +205,9 @@ use following: ...@@ -205,9 +205,9 @@ use following:
``` ```
{ {
content: "some content", content: "some content",
author_name: author1, author_name: author1,
author_email: author1@domain.com author_email: author1@domain.com
} }
``` ```
...@@ -231,13 +231,13 @@ you also have to configure the `cache` component to be `yii\mongodb\Cache`: ...@@ -231,13 +231,13 @@ you also have to configure the `cache` component to be `yii\mongodb\Cache`:
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
// ... // ...
'cache' => [ 'cache' => [
'class' => 'yii\mongodb\Cache', 'class' => 'yii\mongodb\Cache',
], ],
] ]
]; ];
``` ```
...@@ -250,12 +250,12 @@ you also have to configure the `session` component to be `yii\mongodb\Session`: ...@@ -250,12 +250,12 @@ you also have to configure the `session` component to be `yii\mongodb\Session`:
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
// ... // ...
'session' => [ 'session' => [
'class' => 'yii\mongodb\Session', 'class' => 'yii\mongodb\Session',
], ],
] ]
]; ];
``` ```
\ No newline at end of file
...@@ -9,15 +9,15 @@ To use this extension, you have to configure the Connection class in your applic ...@@ -9,15 +9,15 @@ To use this extension, you have to configure the Connection class in your applic
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
'redis' => [ 'redis' => [
'class' => 'yii\redis\Connection', 'class' => 'yii\redis\Connection',
'hostname' => 'localhost', 'hostname' => 'localhost',
'port' => 6379, 'port' => 6379,
'database' => 0, 'database' => 0,
], ],
] ]
]; ];
``` ```
...@@ -54,13 +54,13 @@ you also have to configure the `cache` component to be `yii\redis\Cache`: ...@@ -54,13 +54,13 @@ you also have to configure the `cache` component to be `yii\redis\Cache`:
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
// ... // ...
'cache' => [ 'cache' => [
'class' => 'yii\redis\Cache', 'class' => 'yii\redis\Cache',
], ],
] ]
]; ];
``` ```
...@@ -69,18 +69,18 @@ cache component (no connection application component needs to be configured in t ...@@ -69,18 +69,18 @@ cache component (no connection application component needs to be configured in t
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
// ... // ...
'cache' => [ 'cache' => [
'class' => 'yii\redis\Cache', 'class' => 'yii\redis\Cache',
'redis' => [ 'redis' => [
'hostname' => 'localhost', 'hostname' => 'localhost',
'port' => 6379, 'port' => 6379,
'database' => 0, 'database' => 0,
], ],
], ],
] ]
]; ];
``` ```
...@@ -92,13 +92,13 @@ you also have to configure the `session` component to be `yii\redis\Session`: ...@@ -92,13 +92,13 @@ you also have to configure the `session` component to be `yii\redis\Session`:
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
// ... // ...
'session' => [ 'session' => [
'class' => 'yii\redis\Session', 'class' => 'yii\redis\Session',
], ],
] ]
]; ];
``` ```
...@@ -107,18 +107,18 @@ cache component (no connection application component needs to be configured in t ...@@ -107,18 +107,18 @@ cache component (no connection application component needs to be configured in t
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
// ... // ...
'session' => [ 'session' => [
'class' => 'yii\redis\Session', 'class' => 'yii\redis\Session',
'redis' => [ 'redis' => [
'hostname' => 'localhost', 'hostname' => 'localhost',
'port' => 6379, 'port' => 6379,
'database' => 0, 'database' => 0,
], ],
], ],
] ]
]; ];
``` ```
...@@ -139,29 +139,29 @@ The following is an example model called `Customer`: ...@@ -139,29 +139,29 @@ The following is an example model called `Customer`:
```php ```php
class Customer extends \yii\redis\ActiveRecord class Customer extends \yii\redis\ActiveRecord
{ {
/** /**
* @return array the list of attributes for this record * @return array the list of attributes for this record
*/ */
public function attributes() public function attributes()
{ {
return ['id', 'name', 'address', 'registration_date']; return ['id', 'name', 'address', 'registration_date'];
} }
/** /**
* @return ActiveQuery defines a relation to the Order record (can be in other database, e.g. elasticsearch or sql) * @return ActiveQuery defines a relation to the Order record (can be in other database, e.g. elasticsearch or sql)
*/ */
public function getOrders() public function getOrders()
{ {
return $this->hasMany(Order::className(), ['customer_id' => 'id']); return $this->hasMany(Order::className(), ['customer_id' => 'id']);
} }
/** /**
* Defines a scope that modifies the `$query` to return only active(status = 1) customers * Defines a scope that modifies the `$query` to return only active(status = 1) customers
*/ */
public static function active($query) public static function active($query)
{ {
$query->andWhere(['status' => 1]); $query->andWhere(['status' => 1]);
} }
} }
``` ```
......
...@@ -7,17 +7,17 @@ To use this extension, simply add the following code in your application configu ...@@ -7,17 +7,17 @@ To use this extension, simply add the following code in your application configu
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
'view' => [ 'view' => [
'renderers' => [ 'renderers' => [
'tpl' => [ 'tpl' => [
'class' => 'yii\smarty\ViewRenderer', 'class' => 'yii\smarty\ViewRenderer',
//'cachePath' => '@runtime/Smarty/cache', //'cachePath' => '@runtime/Smarty/cache',
], ],
], ],
], ],
], ],
]; ];
``` ```
......
...@@ -33,8 +33,8 @@ In order to setup Sphinx "searchd" to support MySQL protocol following configura ...@@ -33,8 +33,8 @@ In order to setup Sphinx "searchd" to support MySQL protocol following configura
``` ```
searchd searchd
{ {
listen = localhost:9306:mysql41 listen = localhost:9306:mysql41
... ...
} }
``` ```
...@@ -46,15 +46,15 @@ To use this extension, simply add the following code in your application configu ...@@ -46,15 +46,15 @@ To use this extension, simply add the following code in your application configu
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
'sphinx' => [ 'sphinx' => [
'class' => 'yii\sphinx\Connection', 'class' => 'yii\sphinx\Connection',
'dsn' => 'mysql:host=127.0.0.1;port=9306;', 'dsn' => 'mysql:host=127.0.0.1;port=9306;',
'username' => '', 'username' => '',
'password' => '', 'password' => '',
], ],
], ],
]; ];
``` ```
...@@ -67,13 +67,13 @@ use yii\sphinx\ActiveRecord; ...@@ -67,13 +67,13 @@ use yii\sphinx\ActiveRecord;
class Article extends ActiveRecord class Article extends ActiveRecord
{ {
/** /**
* @return string the name of the index associated with this ActiveRecord class. * @return string the name of the index associated with this ActiveRecord class.
*/ */
public static function indexName() public static function indexName()
{ {
return 'idx_article'; return 'idx_article';
} }
} }
``` ```
...@@ -86,10 +86,10 @@ use yii\sphinx\Query; ...@@ -86,10 +86,10 @@ use yii\sphinx\Query;
$query = new Query; $query = new Query;
$query->from('yii2_test_article_index')->match('development'); $query->from('yii2_test_article_index')->match('development');
$provider = new ActiveDataProvider([ $provider = new ActiveDataProvider([
'query' => $query, 'query' => $query,
'pagination' => [ 'pagination' => [
'pageSize' => 10, 'pageSize' => 10,
] ]
]); ]);
$models = $provider->getModels(); $models = $provider->getModels();
``` ```
...@@ -99,10 +99,10 @@ use yii\data\ActiveDataProvider; ...@@ -99,10 +99,10 @@ use yii\data\ActiveDataProvider;
use app\models\Article; use app\models\Article;
$provider = new ActiveDataProvider([ $provider = new ActiveDataProvider([
'query' => Article::find(), 'query' => Article::find(),
'pagination' => [ 'pagination' => [
'pageSize' => 10, 'pageSize' => 10,
] ]
]); ]);
$models = $provider->getModels(); $models = $provider->getModels();
``` ```
...@@ -7,12 +7,12 @@ To use this extension, simply add the following code in your application config ...@@ -7,12 +7,12 @@ To use this extension, simply add the following code in your application config
```php ```php
return [ return [
//.... //....
'components' => [ 'components' => [
'mail' => [ 'mail' => [
'class' => 'yii\swiftmailer\Mailer', 'class' => 'yii\swiftmailer\Mailer',
], ],
], ],
]; ];
``` ```
......
...@@ -88,7 +88,7 @@ html,body{ ...@@ -88,7 +88,7 @@ html,body{
line-height: 1.25; line-height: 1.25;
} }
.header pre{ .header pre{
margin: 10px 0; margin: 10px 0;
} }
/* previous exceptions */ /* previous exceptions */
...@@ -134,8 +134,8 @@ html,body{ ...@@ -134,8 +134,8 @@ html,body{
color: #aaa; color: #aaa;
} }
.header .previous pre{ .header .previous pre{
font-size: 14px; font-size: 14px;
margin: 10px 0; margin: 10px 0;
} }
/* call stack */ /* call stack */
...@@ -355,9 +355,9 @@ html,body{ ...@@ -355,9 +355,9 @@ html,body{
<?php endif; ?> <?php endif; ?>
<h2><?= nl2br($handler->htmlEncode($exception->getMessage())) ?></h2> <h2><?= nl2br($handler->htmlEncode($exception->getMessage())) ?></h2>
<?php if ($exception instanceof \yii\db\Exception && !empty($exception->errorInfo)) { <?php if ($exception instanceof \yii\db\Exception && !empty($exception->errorInfo)) {
echo '<pre>Error Info: ' . print_r($exception->errorInfo, true) . '</pre>'; echo '<pre>Error Info: ' . print_r($exception->errorInfo, true) . '</pre>';
} ?> } ?>
<?= $handler->renderPreviousExceptions($exception) ?> <?= $handler->renderPreviousExceptions($exception) ?>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment