$pageSize = \Yii::$app->session->get('paginationSize', 12);
$myPagination = new Pagination([
'totalCount' => $countQuery->count(),
'defaultPageSize' => $pageSize,
]);
$urlForTwelveItems = $this->myPagination->createUrl(0, 12); //Не надо так
//Сделайте хотя бы так
$sizes = [
12,
24,
36
];
$links = [];
foreach ($sizes as $size){
$links[] = $myPagination->createUrl(0, $size);
}
<?php $form = ActiveForm::begin([
'action'=>'cart/checkout',
'method'=>'post',
'id'=>'deliveryForm',
'enableAjaxValidation' => true
]) ?>
<?php
$config = [
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
],
],
];
if(YII_ENV == YII_ENV_DEV){
unset($config['components']['cache']);
}
return $config;
$list = explode(PHP_EOL, file_get_contents("data/bot.dat"));
<?php
namespace common\helpers\DataObjects;
/**
* Class DateInterval
* @package common\helpers\DataObjects
*/
class DateInterval
{
private $start;
private $end;
/**
* DateInterval constructor.
* @param $start
* @param $end
*/
public function __construct($start, $end){
$this->start = new \DateTime($start);
$this->end = new \DateTime($end);
}
/**
* @return \DateTime
*/
public function start(){
return $this->start;
}
/**
* @return \DateTime
*/
public function end(){
return $this->end;
}
/**
* @param DateInterval $interval
* @return bool
*/
public function hasOverlap(DateInterval $interval) : bool {
return
$this->start > $interval->end() ||
$this->end < $interval->start()
? false : true;
}
}