当前位置: 首页>>代码示例>>PHP>>正文


PHP Model::getDays方法代码示例

本文整理汇总了PHP中yii\base\Model::getDays方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::getDays方法的具体用法?PHP Model::getDays怎么用?PHP Model::getDays使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\base\Model的用法示例。


在下文中一共展示了Model::getDays方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $hours = [];
     for ($i = 0; $i < 25; $i++) {
         $hours[$i] = $i < 10 ? '0' . $i : $i;
     }
     $minutes = [];
     for ($i = 0; $i < 60; $i++) {
         $minutes[$i] = $i < 10 ? '0' . $i : $i;
     }
     $content = '';
     $content .= Html::beginTag('div', ['id' => $this->getId()]);
     $content .= Html::beginTag('div', ['class' => 'control']);
     $content .= $this->renderButtons();
     $content .= Html::beginTag('div', ['class' => 'opening-hours-block time']);
     $content .= Html::beginTag('div', ['class' => 'inputs']);
     $content .= Html::tag('span', '', ['class' => 'glyphicon glyphicon-time']);
     $content .= Html::dropDownList('work-from-hours', null, $hours, ['class' => 'form-control work-from-hours']) . ' : ';
     $content .= Html::dropDownList('work-from-minutes', null, $minutes, ['class' => 'form-control work-from-minutes']) . ' — ';
     $content .= Html::dropDownList('work-to-hours', null, $hours, ['class' => 'form-control work-to-hours']) . ' : ';
     $content .= Html::dropDownList('work-to-minutes', null, $minutes, ['class' => 'form-control work-to-minutes']);
     $content .= Html::endTag('div');
     $content .= Html::beginTag('div', ['class' => 'inputs timeout-block', 'style' => 'display:none']);
     $content .= Html::tag('span', '', ['class' => 'glyphicon glyphicon-cutlery']);
     $content .= Html::dropDownList('timeout-from-hours', null, $hours, ['class' => 'form-control timeout-from-hours']) . ' : ';
     $content .= Html::dropDownList('timeout-from-minutes', null, $minutes, ['class' => 'form-control timeout-from-minutes']) . ' — ';
     $content .= Html::dropDownList('timeout-to-hours', null, $hours, ['class' => 'form-control timeout-to-hours']) . ' : ';
     $content .= Html::dropDownList('timeout-to-minutes', null, $minutes, ['class' => 'form-control timeout-to-minutes']);
     $content .= Html::endTag('div');
     $content .= Html::a('круглосуточно', '#', ['class' => 'dotted alltime-btn']);
     $content .= Html::a('перерыв', '#', ['class' => 'dotted timeout-btn']);
     $content .= Html::tag('div', '', ['class' => 'shirma']);
     $content .= Html::endTag('div');
     $content .= Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-plus-sign']), '#', ['class' => 'link add-control-btn']);
     $content .= Html::endTag('div');
     foreach ($this->schedule->getDays() as $day) {
         $content .= $this->form->field($this->schedule, "{$day}[0][from][hours]", ['options' => ['class' => null]])->hiddenInput()->label(false);
         $content .= $this->form->field($this->schedule, "{$day}[0][from][minutes]", ['options' => ['class' => null]])->hiddenInput()->label(false);
         $content .= $this->form->field($this->schedule, "{$day}[0][to][hours]", ['options' => ['class' => null]])->hiddenInput()->label(false);
         $content .= $this->form->field($this->schedule, "{$day}[0][to][minutes]", ['options' => ['class' => null]])->hiddenInput()->label(false);
         $content .= $this->form->field($this->schedule, "{$day}[1][from][hours]", ['options' => ['class' => null]])->hiddenInput()->label(false);
         $content .= $this->form->field($this->schedule, "{$day}[1][from][minutes]", ['options' => ['class' => null]])->hiddenInput()->label(false);
         $content .= $this->form->field($this->schedule, "{$day}[1][to][hours]", ['options' => ['class' => null]])->hiddenInput()->label(false);
         $content .= $this->form->field($this->schedule, "{$day}[1][to][minutes]", ['options' => ['class' => null]])->hiddenInput()->label(false);
     }
     $content .= Html::endTag('div');
     return $content;
 }
开发者ID:consultnn,项目名称:yii2-opening-hours,代码行数:48,代码来源:OpeningHours.php


注:本文中的yii\base\Model::getDays方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。