本文整理汇总了PHP中HeaderField::setAllowHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP HeaderField::setAllowHTML方法的具体用法?PHP HeaderField::setAllowHTML怎么用?PHP HeaderField::setAllowHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeaderField
的用法示例。
在下文中一共展示了HeaderField::setAllowHTML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($name, $title = null, $value = null, $modifier = null)
{
$this->name = $name . '[' . $modifier . ']';
$this->setTitle($title);
$this->modifier = $modifier;
$dayArray = array(0 => 'Day');
for ($i = 1; $i < 32; $i++) {
if ($i < 10) {
$dayArray['0' . $i] = $i;
} else {
$dayArray[$i] = $i;
}
}
$monthArray = array('0' => 'Month', '01' => 'Jan', '02' => 'Feb', '03' => 'March', '04' => 'Apr', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'Aug', '09' => 'Sept', '10' => 'Oct', '11' => 'Nov', '12' => 'Dec');
$now = new DateTime();
$startYear = $now->format('Y');
$endYear = $startYear - 105;
$yearArray = array(0 => 'Year');
for ($i = $startYear; $i >= $endYear; $i--) {
$yearArray[$i] = $i;
}
$fields = array($this->day = new DropdownField($this->name . '[Day]', '', $dayArray), $this->month = new DropdownField($this->name . '[Month]', '', $monthArray), $this->year = new DropdownField($this->name . '[Year]', '', $yearArray));
foreach ($fields as $field) {
$field->addExtraClass('dateselectorfield');
}
if ($title) {
if ($this->useHeading) {
array_unshift($fields, $header = new HeaderField($this->name . $this->modifier . 'Title', trim($title . ' ' . $this->modifier), 4));
$header->setAllowHTML(true);
} else {
array_unshift($fields, new LiteralField($this->name . $this->modifier . 'Title', '<label class="left" for="' . $this->name . '">' . trim($title . ' ' . $this->modifier) . '</label>'));
}
}
Requirements::css('datedropdownselectorfield/css/admin.css');
parent::__construct($fields);
$this->setValue($value);
}
开发者ID:helpfulrobot,项目名称:dnadesign-silverstripe-datedropdownselectorfield,代码行数:37,代码来源:DateSelectorField.php