本文整理汇总了PHP中SibdietHelper::dayToString方法的典型用法代码示例。如果您正苦于以下问题:PHP SibdietHelper::dayToString方法的具体用法?PHP SibdietHelper::dayToString怎么用?PHP SibdietHelper::dayToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SibdietHelper
的用法示例。
在下文中一共展示了SibdietHelper::dayToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}