當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SibdietHelper::convertMeals方法代碼示例

本文整理匯總了PHP中SibdietHelper::convertMeals方法的典型用法代碼示例。如果您正苦於以下問題:PHP SibdietHelper::convertMeals方法的具體用法?PHP SibdietHelper::convertMeals怎麽用?PHP SibdietHelper::convertMeals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SibdietHelper的用法示例。


在下文中一共展示了SibdietHelper::convertMeals方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getInput

 /**
  * Method to get the field input markup for check boxes.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $html = array();
     // Get default id
     $this->defaults_id = $this->form->getValue('defaults_id') ? $this->form->getValue('defaults_id') : 0;
     // Set days
     $days = $this->element['days'] ? $this->element['days'] : '1-2-3-4-5-6-7';
     $days = $this->form->getValue('days') ? $this->form->getValue('days') : $days;
     $days = explode('-', $days);
     // Set meals
     $meals = $this->element['meals'] ? $this->element['meals'] : '1,2,3';
     $meals = $this->form->getValue('meal') ? $this->form->getValue('meal') : $meals;
     $meals = explode(',', $meals);
     // Temp value
     $value_array = $this->value;
     foreach ($meals as $meal) {
         $this->meal = $meal;
         $options = (array) $this->getOptions();
         $html[] = '<div class="span4">';
         $html[] = '<div class="control-group center">' . SibdietHelper::convertMeals($meal) . '</div>';
         foreach ($days as $day) {
             $this->value = isset($value_array[$meal][$day]) ? $value_array[$meal][$day] : '';
             $this->name = 'jform[' . $this->fieldname . '][' . $meal . '][' . $day . ']';
             $this->id = $this->id . 'meal' . $meal . 'day' . $day;
             $this->hint = SibdietHelper::dayToString($day);
             $html[] = '<div class="control-group center">';
             $html[] = parent::getInput();
             $html[] = '</div>';
         }
         $html[] = '</div>';
     }
     return implode($html);
 }
開發者ID:smhnaji,項目名稱:sdnet,代碼行數:40,代碼來源:defaultsfoods.php

示例2:

            ?>
								<?php 
            echo $this->escape($item->title);
            ?>
							<?php 
        }
        ?>
							<div class="small">
								<?php 
        echo JText::_('COM_SIBDIET_DIET') . ': ' . $this->escape($item->diets_title);
        ?>
							</div>
						</td>
						<td class="hidden-phone">
							<?php 
        echo SibdietHelper::convertMeals($item->meal);
        ?>
						</td>
						<td class="hidden-phone">
							<?php 
        echo SibdietHelper::convertSeasons($item->season);
        ?>
						</td>
						<td class="small nowrap hidden-phone">
							<?php 
        if ($item->language == '*') {
            ?>
								<?php 
            echo JText::alt('JALL', 'language');
            ?>
							<?php 
開發者ID:smhnaji,項目名稱:sdnet,代碼行數:31,代碼來源:default.php


注:本文中的SibdietHelper::convertMeals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。