Сообщения

Сообщения за Декабрь, 2017

Оптимизация запросов yii2

Изображение
проект https://gitlab.com/des1roer/yii2pet

пусть view views/pers/index.php


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31<?= GridView::widget([ 'dataProvider'=>$dataProvider, 'columns'=> [ 'name', 'lvl', 'money', [ 'attribute'=>'race_id', 'format'=>'raw', 'label'=>'раса', 'filter'=>$races, 'value'=>'race.name' ], [ 'label'=>'Изображение', 'format'=>'html', 'value'=>function ($data) { return Html::img($data->race->img, ['width'=>'100']); }, ], [ &#…

Авторизация через Гугл аккаунт

https://console.developers.google.com/apis/credentials

----------------
<script async defer src="https://apis.google.com/js/api.js"      onload="this.onload=function(){};handleClientLoad()"      onreadystatechange="if (this.readyState === 'complete') this.onload()"></script>?>
----------- // Enter an API key from the Google API Console:// https://console.developers.google.com/apis/credentialsvar apiKey ='**********';// Enter the API Discovery Docs that describes the APIs you want to// access. In this example, we are accessing the People API, so we load// Discovery Doc found here: https://developers.google.com/people/api/rest/var discoveryDocs =["https://people.googleapis.com/$discovery/rest?version=v1"];// Enter a client ID for a web application from the Google API Console:// https://console.developers.google.com/apis/credentials?project=_// In your API Console project, add a JavaScript origin that corresponds//…

Yii2 апгрейдим функции

просто установим

composer require illuminate/support

и можно использовать https://laravel.com/docs/5.5/helpers#introduction