本文整理汇总了PHP中Option::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::create方法的具体用法?PHP Option::create怎么用?PHP Option::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Option
的用法示例。
在下文中一共展示了Option::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
Option::create(['name' => 'default_language', 'friendly_name' => 'Default Language', 'value' => 'en', 'options' => "en|nl|de", 'description' => 'If no language is set by the user, this is the default']);
Option::create(['name' => 'application_title', 'friendly_name' => 'Application Title', 'value' => 'SSMS', 'description' => 'The title used in various places around the application']);
Option::create(['name' => 'theme', 'friendly_name' => 'Theme', 'value' => 'blue', 'options' => "blue|red|green", 'description' => 'The colour theme the application']);
Option::create(['name' => 'companion_script', 'friendly_name' => 'SSMS Companion Shell Script', 'value' => 'true', 'options' => "true|false", 'description' => 'Whether or not you are using the SSMS shell script to control your servers']);
}
示例2: _register
function _register($params)
{
$name = $params['name'];
$url = $params['url'];
$user = $params['user'];
Option::create()->grouping('external')->name($name)->value($url)->insert();
Status::create()->data('External created.')->type('system')->user_id($user->id)->user_to($user->id)->cssclass('ok')->insert();
return true;
}
示例3: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('options', function (Blueprint $table) {
$table->increments('id');
$table->string('key')->unique();
$table->string('value');
$table->timestamps();
});
Option::create(['key' => 'exp', 'value' => '2015-01-09']);
}
示例4: _heavy
function _heavy($params)
{
$user = $params['user'];
DB::get()->query("DELETE FROM options where user_id = ? and grouping = 'Identity' and name = 'heavy'", array($user->id));
Option::create()->grouping('Identity')->name('heavy')->value('true')->user_id($user->id)->insert();
Status::create()->data('You are now heavy.')->cssclass('ok')->user_id($user->id)->type('direct')->user_to($user->id)->insert();
return true;
}
示例5: foreach
$sql = "SELECT * FROM questions ORDER BY question_id desc limit 1";
$result_set = $database->execute_query($sql);
$row = $database->fetch_array($result_set);
$question_id = array_shift($row);
//set default value 'false' to $if_created...
//Used to display success of error message to user...
$if_created = 'false';
$options = $_POST['option_content'];
$option_id = 1;
foreach ($options as $option) {
$new_option = new Option();
$new_option->option_id = $option_id;
$new_option->option_content = $option;
$new_option->question_id = $question_id;
//If everything goes right, 'if_created' should be 'true'...
$if_creted = $new_option->create();
$option_id++;
}
}
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Neon Admin Panel" />
<meta name="author" content="" />
<title>LLSCT | Create Survey</title>