本文整理汇总了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);
}
示例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