Exemplo n.º 1
0
<?php

use im\base\Module;
/* @var $this yii\web\View */
/* @var $itemContent string */
/* @var $widget im\base\widgets\ListView */
if ($widget->addLabel !== false) {
    ?>
    <button type="button" class="btn btn-success" data-action="add">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?php 
    echo $widget->addLabel ? $widget->addLabel : Module::t('list-view', 'Add');
    ?>
    </button>
    <br /><br />
<?php 
}
Exemplo n.º 2
0
<?php

use im\base\Module;
/* @var $this yii\web\View */
/* @var $widget im\base\widgets\RelationWidget */
$models = $widget->relation->all();
if ($widget->addLabel !== false) {
    ?>
<button type="button" class="btn btn-success" data-action="add">
    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?php 
    echo $widget->addLabel ? $widget->addLabel : Module::t('relation-widget', 'Add');
    ?>
</button>
<br /><br />
<?php 
}
?>
<div class="list" data-cont="list">
<?php 
foreach ($models as $index => $model) {
    ?>
    <?php 
    echo $this->render('relation_widget_item', ['model' => $model, 'sortable' => $widget->sortable, 'index' => $index + 1, 'modelView' => $widget->modelView, 'form' => $widget->form]);
}
?>
</div>
<div data-cont="temp"></div>