$file = Yii::$app->cache->getOrSet($rest . '.' . $ext, function () use ($rest, $ext){
return file_get_contents('http://example.com/' . $rest . '.' . $ext, true);
});
defined('LOCALHOST') or define('LOCALHOST', in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']));
'db' => LOCALHOST ? require __DIR__ . '/db-local.php' : require __DIR__ . '/db.php';
public function getDataProvider()
{
return new SqlDataProvider([
'sql' => 'select `tag`.*, (select count(*) from `tag_join_page` where `tag_join_page`.`id_tag` = `tag`.`id_tag`) as `total` from `tag` order by `total` DESC',
'pagination' => [
'pageSize' => 50
]
]);
}
Html::activeInput
ничего валидироваться не будет. нужно использовать ActiveForm.$response = $this->client->createRequest()
->setUrl($this->redmineLink)
->setMethod('POST')
->setFormat(Client::FORMAT_JSON)
->addHeaders(['Content-Type' => 'application/json'])
->setContent($queue->params)
->send();
public $sourcePath = '@vendor/bower-asset/fortawesome/font-awesome';
public $sourcePath = '@vendor/bower/fortawesome/font-awesome';
<?php
namespace app\modules\admin;
use Yii;
use yii\base\BootstrapInterface;
use yii\base\InvalidConfigException;
use yii\web\Application;
/**
* admin module definition class
*/
class Module extends \yii\base\Module implements BootstrapInterface
{
/**
* @inheritdoc
*/
public $controllerNamespace = 'app\modules\admin\controllers';
/**
* @inheritdoc
*/
public function init()
{
parent::init();
}
public function bootstrap($app)
{
if ($app instanceof Application) {
$app->getAssetManager()->baseUrl = '@web/assets-admin';
$app->getAssetManager()->basePath = $_SERVER['DOCUMENT_ROOT'] . '/web/assets-admin';
}
}
}