Advertisement
Greenice

Yii2 View Example

Jan 31st, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.64 KB | None | 0 0
  1. <?php
  2.  
  3. $this->hideSlider(false);
  4. $this->headerClass = ((app()->settings->get('cms', 'displaySearchOnAccount') == 1) ? Controller::SEARCH_BOX_HEADER : Controller::NO_HEADER);
  5.  
  6. $this->layout = '//layouts/inner_wide_white';
  7.  
  8. $this->actionTitle = Yii::t('Orders and carts', 'MY ORDERS');
  9.  
  10. $this->widget('bootstrap.widgets.TbGridView', array(
  11.     'id' => 'order-grid',
  12.     'dataProvider' => $model->ordered()->search(),
  13.     'template' => '<header><span class="num">&nbsp;&nbsp;&nbsp;</span>' . Yii::t('Orders and carts', 'My Orders') . '</header>{items}',
  14.     'htmlOptions' => array(
  15.         'class' => 'grid-view box-page'
  16.     ),
  17.     'columns' => array(
  18.         array(
  19.             'name' => 'id',
  20.             'type' => 'html',
  21.             'value' => '$data->generateLink($data->getReference())',
  22.             'htmlOptions' => array('class' => 'model-reference')
  23.         ),
  24.         array('name' => 'purchased_date',
  25.             'value' => 'app()->format->formatBookDate($data->purchased_date)'
  26.         ),
  27.         array(
  28.             'header' => Yii::t('Orders and carts', 'Experiences'),
  29.             'value' => '$data->getNumExperiences()',
  30.         ),
  31.         array(
  32.             'header' => Yii::t('Orders and carts', 'Add-ons'),
  33.             'value' => '$data->getNumExtras()',
  34.         ),
  35.         array(
  36.             'name' => 'orderbookinglocation_id',
  37.             'value' => '$data->orderbookinglocation->name',
  38.         ),
  39.         array(
  40.             'header' => Yii::t('Orders and carts', 'Subtotal'),
  41.             'value' => 'app()->numberFormatter->formatCurrency($data->subtotal, app()->settings->get(\'settings\', \'defaultCurrency\'))',
  42.         ),
  43.         array(
  44.             'header' => Yii::t('Orders and carts', 'Discount'),
  45.             'value' => 'app()->numberFormatter->formatCurrency($data->discount, app()->settings->get(\'settings\', \'defaultCurrency\'))',
  46.         ),
  47.         array(
  48.             'header' => Yii::t('Orders and carts', 'Tax'),
  49.             'value' => 'app()->numberFormatter->formatCurrency($data->getTax(), app()->settings->get(\'settings\', \'defaultCurrency\'))',
  50.         ),
  51.         array(
  52.             'header' => Yii::t('Orders and carts', 'Total'),
  53.             'value' => 'app()->numberFormatter->formatCurrency($data->getTotal(), app()->settings->get(\'settings\', \'defaultCurrency\'))',
  54.         ),
  55.         array(
  56.             'name' => 'paid',
  57.             'type' => 'html',
  58.             'filter' => '',
  59.             'value' => 'OrderViewHelper::getPaidLabel($data->isNotCompletedPaid())',
  60.         ),
  61.         array(
  62.             'class' => 'ExButtonColumn',
  63.             'template' => '{view}',
  64.         ),
  65.     ),
  66. ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement