Example #1
0
 public function getCurrency()
 {
     return $this->hasOne(Currecies::className(), array('id' => 'currency_id'));
 }
Example #2
0
<?php

use app\models\Currecies;
$this->params["breadcrumbs"] = array('Currates' => array('index'), 'Manage');
$this->params["menu"] = array(array('label' => Yii::t('app', 'Create Currency Rate'), 'url' => array('create')));
?>


<?php 
app\widgets\MiniForm::begin(array('header' => Yii::t('app', "Manage Currencies Rates")));
?>

<?php 
$dateisOn = kartik\datecontrol\DateControl::widget(['model' => $model, 'attribute' => 'from', 'type' => 'date']) . kartik\datecontrol\DateControl::widget(['model' => $model, 'attribute' => 'to', 'type' => 'date']);
?>



<?php 
echo app\widgets\GridView::widget(array('id' => 'currates-grid', 'dataProvider' => $model->dp(), 'columns' => array(array('attribute' => 'currency_id', 'filter' => \yii\helpers\ArrayHelper::map(Currecies::find()->All(), 'id', 'name')), array('attribute' => 'date'), 'value')));
app\widgets\MiniForm::end();
Example #3
0
use app\models\Currecies;
use kartik\select2\Select2;
?>

<div class="form">

<?php 
$form = kartik\form\ActiveForm::begin(array('id' => 'currates-form', 'enableAjaxValidation' => false));
?>

	<?php 
echo $form->errorSummary($model);
?>

                <?php 
echo $form->field($model, 'currency_id')->widget(Select2::classname(), ['data' => \yii\helpers\ArrayHelper::map(Currecies::find()->All(), 'id', 'name')]);
?>
                <br />
		
           
		<?php 
//echo $form->labelEx($model,'value');
?>
		<?php 
echo $form->field($model, 'value');
?>
		<?php 
//echo $form->error($model,'value');
?>
	
	<div class="form-actions">