本文整理汇总了PHP中DropdownField::setForm方法的典型用法代码示例。如果您正苦于以下问题:PHP DropdownField::setForm方法的具体用法?PHP DropdownField::setForm怎么用?PHP DropdownField::setForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DropdownField
的用法示例。
在下文中一共展示了DropdownField::setForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Field
/**
* @todo This should be generated by JavaScript, but we don't have the date libraries'
*/
function Field($properties = array())
{
$this->addExtraClass('timedropdownfield');
$html = parent::Field($properties);
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript('framework/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript('timedropdownfield/javascript/TimeDropdownField.js');
Requirements::css('timedropdownfield/css/TimeDropdownField.css');
$iteratedTime = new Zend_Date('00:00:00', 'h:mm:ss');
$options = array();
$count = 24 * (60 / $this->config['interval']);
for ($i = 0; $i < $count; $i++) {
$key = $iteratedTime->toString($this->getConfig('datavalueformat'));
$options[$key] = $iteratedTime->toString($this->getConfig('timeformat'));
$iteratedTime->add($this->config['interval'], Zend_Date::MINUTE);
}
$dropdownField = new DropdownField('dropdown_' . $this->getName(), false, $options, $this->Value());
$dropdownField->addExtraClass('presets');
$dropdownField->setHasEmptyDefault(true);
$dropdownField->setForm($this->getForm());
$html .= $dropdownField->Field();
$html .= '<a href="#" class="presets-trigger"></a>';
return $html;
}