class ShopController extends Controller
{
public function actionCategory($slug){
//logic
return $this->render('category_template');
}
public function actionProduct($slug){
//logic
return $this->render('product_template');
}
}
$cmd = "../CronTask.php";
passthru($cmd);
module.exports = {
attributes: {
title: {
type: 'string',
maxLength: 120,
required: true
},
description: {
type: 'string',
required: true
},
content: {
type: 'string',
required: true
}
},
validationMessages: {
description: {
required: 'Описание обязательно для заполнения'
},
content: {
required: 'Содержание обязательно для заполнения'
},
title:{
required: 'Название обязательно для заполнения'
}
}
};
index: function (req, res) {
// Поиск в модели Post
Post.find()
.sort('id DESC')
.paginate({page: req.param('page', 1), limit: 1})
.exec(function (err, posts) {
// Если ошибка вывести страницу 500 (с логом)
if (err) return res.send(500);
res.view({
posts: posts,
currentPage: req.param('page', 1),
countItems: posts.length
});
});
},
[Composer\DependencyResolver\SolverProblemsException]
Problem 1
- The requested package amstr1k/yii2-category could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
if(count($arr['jpg']) > 5 || count($arr['pdf']) > 1 )
return;