Example #1
0
			<ul class="list-unstyled">
				<?php 
foreach ($model->getRecent() as $m) {
    echo '<li>' . Html::a($m->title, ["//yes/product/view", "id" => $m->id, "title" => $m->title]) . '</li>';
}
?>
		
			</ul>
			<hr>
			<h4><?php 
echo Yii::t("app", "Categories");
?>
</h4>
			<ul class="nav nav-pills nav-stacked">
				<?php 
foreach ($cat->parents() as $c) {
    echo '<li>' . Html::a($c->title, ["//yes/product/index", "category" => $c->title]) . '</li>';
}
?>
						
			</ul>
			<hr>
			<h4><?php 
echo Yii::t("app", "Archive");
?>
</h4>
			<ul class="nav nav-pills">
				<?php 
foreach ($model->getArchived() as $m) {
    echo '<li>' . Html::a(date('M Y', strtotime($m["month"])), ["//yes/product/index", "time" => $m["month"]]) . '</li>';
}
Example #2
0
use kartik\datetime\DateTimePicker;
use amilna\yes\models\Category;
use iutbay\yii2kcfinder\KCFinderInputWidget;
$module = Yii::$app->getModule('yes');
if ($module->enableUpload) {
    // kcfinder options
    // http://kcfinder.sunhater.com/install#dynamic
    $kcfOptions = array_merge([], ['uploadURL' => Yii::getAlias($module->uploadURL), 'uploadDir' => Yii::getAlias($module->uploadDir), 'access' => ['files' => ['upload' => true, 'delete' => false, 'copy' => false, 'move' => false, 'rename' => false], 'dirs' => ['create' => true, 'delete' => false, 'rename' => false]], 'types' => ['files' => "", 'images' => "*img"], 'thumbWidth' => 260, 'thumbHeight' => 260]);
    // Set kcfinder session options
    Yii::$app->session->set('KCFINDER', $kcfOptions);
}
/* @var $this yii\web\View */
/* @var $model amilna\yes\models\Product */
/* @var $form yii\widgets\ActiveForm */
$cat = new Category();
$listCategory = [] + ArrayHelper::map($cat->parents(), 'id', 'title');
$category = $model->isNewRecord ? $model->id['category'] : [];
foreach ($model->catPro as $c) {
    array_push($category, $c->category_id);
}
?>

<div class="product-form">

    <?php 
$form = ActiveForm::begin();
?>

	<div class="row">
		<div class="col-md-9">
			<div class="row">