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


PHP Variable::save方法代碼示例

本文整理匯總了PHP中Variable::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Variable::save方法的具體用法?PHP Variable::save怎麽用?PHP Variable::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Variable的用法示例。


在下文中一共展示了Variable::save方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Variable();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Variable'])) {
         $model->attributes = $_POST['Variable'];
         if ($model->save()) {
             $this->redirect(array('admin'));
         }
         //$this->redirect(array('view','id'=>$model->id));
     }
     $this->render('create', array('model' => $model));
 }
開發者ID:rusli-nasir,項目名稱:smsempresayii,代碼行數:18,代碼來源:VariableController.php

示例2: prepareData

 public function prepareData()
 {
     $site = new Site();
     $site->site_id = 1;
     $site->site_domain = 'site1';
     $site->save();
     $site = new Site();
     $site->site_id = 2;
     $site->site_domain = 'site2';
     $site->save();
     $var = new Variable();
     $var->variable_id = 1;
     $var->variable_name = 'var1';
     $var->save();
     $var = new Variable();
     $var->variable_id = 2;
     $var->variable_name = 'var2';
     $var->save();
     $varval = new SiteVarvalue();
     $varval->site_id = 1;
     $varval->variable_id = 1;
     $varval->varvalue_value = 'val1 dom1 var1';
     $varval->save();
     $varval = new SiteVarvalue();
     $varval->site_id = 1;
     $varval->variable_id = 2;
     $varval->varvalue_value = 'val2 dom1 var2';
     $varval->save();
     $varval = new SiteVarvalue();
     $varval->site_id = 2;
     $varval->variable_id = 1;
     $varval->varvalue_value = 'val3 dom2 var1';
     $varval->save();
     $varval = new SiteVarvalue();
     $varval->site_id = 2;
     $varval->variable_id = 2;
     $varval->varvalue_value = 'val4 dom2 var2';
     $varval->save();
 }
開發者ID:dracony,項目名稱:forked-php-orm-benchmark,代碼行數:39,代碼來源:941TestCase.php

示例3: defineFields

 public function defineFields($id)
 {
     $bladetemp = $this->bladetemp->findOrFail($id);
     $file = $bladetemp->file;
     $fullpath = app_path() . '/views/uploads/' . $file;
     $string = file_get_contents($fullpath);
     $string = str_replace('{{', '|{{', $string);
     $strings = explode('|', $string);
     $pattern = "/{{(.*?)}}/";
     //print_r($strings);
     foreach ($strings as $string) {
         if (preg_match($pattern, $string, $matches)) {
             $variable = new Variable();
             $var_title = substr($matches[1], strpos($matches[1], '"') + 2);
             $variable->name = str_replace('"', '', $var_title);
             echo $variable->name;
             $variable->t_id = $id;
             $variable->save();
             //print_r($matches);
         }
     }
     return Redirect::route('variables.assigntypes', array('id' => $id));
 }
開發者ID:bailey9005,項目名稱:Laravel-For-Landing-Pages,代碼行數:23,代碼來源:BladeTempsController.php


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