本文整理匯總了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;
}