當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Option::create方法代碼示例

本文整理匯總了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']);
 }
開發者ID:Zipcore,項目名稱:Sourcemod-Server-Manager-System,代碼行數:7,代碼來源:OptionsTableSeeder.php

示例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;
 }
開發者ID:amitchouhan004,項目名稱:barchat,代碼行數:9,代碼來源:external.php

示例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']);
 }
開發者ID:anthon-alindada,項目名稱:gaming-88,代碼行數:15,代碼來源:2015_01_06_145652_create_options_table.php

示例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;
 }
開發者ID:amitchouhan004,項目名稱:barchat,代碼行數:8,代碼來源:presence.php

示例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>
開發者ID:aarsee,項目名稱:Drexel-Project,代碼行數:31,代碼來源:create-survey.php


注:本文中的Option::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。