本文整理汇总了PHP中TitanFrameworkOption::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP TitanFrameworkOption::factory方法的具体用法?PHP TitanFrameworkOption::factory怎么用?PHP TitanFrameworkOption::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TitanFrameworkOption
的用法示例。
在下文中一共展示了TitanFrameworkOption::factory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createOption
public function createOption($settings)
{
if (!apply_filters('tf_create_option_continue_' . $this->owner->owner->optionNamespace, true, $settings)) {
return null;
}
$obj = TitanFrameworkOption::factory($settings, $this);
$this->options[] = $obj;
do_action('tf_create_option_' . $this->owner->owner->optionNamespace, $obj);
return $obj;
}
示例2: createOption
public function createOption($settings)
{
$obj = TitanFrameworkOption::factory($settings, $this);
// $obj = new TitanFrameworkOption( $settings, $this );
$this->options[] = $obj;
if (!empty($obj->settings['id'])) {
$this->owner->optionsUsed[$obj->settings['id']] = $obj;
}
do_action('tf_create_option', $obj);
return $obj;
}
示例3: init_group_options
/**
* Creates the options contained in the group. Mimics how Admin pages
* create options.
*
* @return void
*/
public function init_group_options()
{
if (!empty($this->settings['options'])) {
if (is_array($this->settings['options'])) {
foreach ($this->settings['options'] as $settings) {
if (!apply_filters('tf_create_option_continue_' . $this->getOptionNamespace(), true, $settings)) {
continue;
}
$obj = TitanFrameworkOption::factory($settings, $this->owner);
$this->options[] = $obj;
do_action('tf_create_option_' . $this->getOptionNamespace(), $obj);
}
}
}
}
示例4: insertOptionBefore
public function insertOptionBefore($settings, $index = null, $overwrite = false)
{
if (is_null($index)) {
return $this->createOption($settings);
}
if (!apply_filters('tf_create_option_continue_' . $this->owner->optionNamespace, true, $settings)) {
return null;
}
$obj = TitanFrameworkOption::factory($settings, $this);
$count = count($this->options);
if (!$overwrite) {
for ($i = $count - 1; $i >= $index; $i--) {
$this->options[$i + 1] = $this->options[$i];
}
}
$this->options[$index] = $obj;
do_action('tf_create_option_' . $this->owner->optionNamespace, $obj);
return $obj;
}
示例5: addSubSection
/**
* Store Subsection
*
* @return void
*/
public function addSubSection($settings)
{
$this->subID = $settings['id'];
$settings['capability'] = 'edit_theme_options';
if (!apply_filters('tf_create_option_continue_' . $this->owner->optionNamespace, true, $settings)) {
return null;
}
$objx = TitanFrameworkOption::factory($settings, $this);
$this->subSec[] = $objx;
do_action('tf_create_option_' . $this->owner->optionNamespace, $objx);
return $objx;
}