本文整理汇总了PHP中Option::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::add方法的具体用法?PHP Option::add怎么用?PHP Option::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Option
的用法示例。
在下文中一共展示了Option::add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main Dashboard admin function
*/
public static function main()
{
// set/update google analytics settings
if (Request::post('ga_settings_update')) {
if (Security::check(Request::post('csrf'))) {
// client id
$ga_client_id = trim(Request::post('ga_client_id'));
if (!empty($ga_client_id)) {
$opt_client_id = Option::get('ga_client_id');
if (empty($opt_client_id)) {
Option::add('ga_client_id', $ga_client_id);
} else {
Option::update('ga_client_id', $ga_client_id);
}
}
// API key
$ga_api_key = trim(Request::post('ga_api_key'));
if (!empty($ga_api_key)) {
$opt_api_key = Option::get('ga_api_key');
if (empty($opt_api_key)) {
Option::add('ga_api_key', $ga_api_key);
} else {
Option::update('ga_api_key', $ga_api_key);
}
}
// view id
$ga_view_id = trim(Request::post('ga_view_id'));
if (!empty($ga_view_id)) {
$opt_view_id = Option::get('ga_view_id');
if (empty($opt_view_id)) {
Option::add('ga_view_id', $ga_view_id);
} else {
Option::update('ga_view_id', $ga_view_id);
}
}
// tracking id
$ga_tracking_id = trim(Request::post('ga_tracking_id'));
if (!empty($ga_tracking_id)) {
$opt_view_id = Option::get('ga_tracking_id');
if (empty($opt_view_id)) {
Option::add('ga_tracking_id', $ga_tracking_id);
} else {
Option::update('ga_tracking_id', $ga_tracking_id);
}
}
}
}
// Display view
View::factory('box/dashboard/views/backend/index')->display();
}
示例2: defined
<?php
// let only monstra allow to use this script
defined('MONSTRA_ACCESS') or die('No direct script access.');
// Add Options
Option::add('toggle_duration', '400');
Option::add('toggle_easing', 'swing');
示例3: defined
<?php
defined('MONSTRA_ACCESS') or die('No direct script access.');
// Add New Options
Option::add('captcha_installed', 'true');
示例4: array
$e->addField('time');
$e->addField('location');
$e->addField('short');
$e->addField('description');
$e->addField('archive');
$e->addField('hashtag');
$e->addField('facebook');
$e->addField('image');
$e->addField('imagesection');
$e->addField('gallery');
$e->addField('audio');
$e->addField('color');
$e->addField('number_staff');
$e->addField('number_visitors');
Table::create('categories', array('title'));
$c = new Table('categories');
$c->addField('deleted');
$c->addField('color');
$c->addField('hidden_in_archive');
Table::create('locations', array('title'));
$l = new Table('locations');
$l->addField('deleted');
$l->addField('website');
$l->addField('address');
$l->addField('lon');
$l->addField('lat');
// Add Options
Option::add('events_image_directory', '/');
Option::add('events_placeholder_archive', '');
Option::add('events_audio_directory', '/');
示例5: defined
<?php
defined('MONSTRA_ACCESS') or die('No direct script access.');
// Add New Options
Option::add('sandbox', 'sandbox test value');
Option::add('sandbox_template', 'index');