当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::find方法代码示例

本文整理汇总了PHP中Settings::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::find方法的具体用法?PHP Settings::find怎么用?PHP Settings::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings的用法示例。


在下文中一共展示了Settings::find方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getStartingID

 private static function getStartingID($directory)
 {
     $coreSettings = Settings::find('core');
     $startingID = 1;
     if (isset($coreSettings->data->startingIDs)) {
         if (isset($coreSettings->data->startingIDs->{$directory}) && is_numeric($coreSettings->data->startingIDs->{$directory})) {
             $startingID = $coreSettings->data->startingIDs->{$directory};
         }
     }
     return $startingID;
 }
开发者ID:divineomega,项目名称:exiguous-ecommerce,代码行数:11,代码来源:ExiguousEcommerceItem.php

示例2: update

 public function update($id)
 {
     $rules = array('value' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::route('admin.settings.edit', array('id' => $id))->withErrors($validator)->With(Input::all());
     } else {
         $setting = Settings::find($id);
         $setting->value = Input::get('value');
         if ($setting->save()) {
             return Redirect::route('admin.settings.index')->with('success', Lang::get('messages.settings_update'));
         }
     }
     return Redirect::route('admin.settings.index')->with('success', Lang::get('messages.settings_update'));
 }
开发者ID:stefferd,项目名称:me-consultancy,代码行数:15,代码来源:SettingsController.php

示例3: savesettings

 public function savesettings()
 {
     if (Input::get('id')) {
         $settings = Settings::find(Input::get('id'));
     } else {
         $settings = new Settings();
     }
     $settings->area = Input::get('area');
     $settings->section = Input::get('section');
     $settings->setting_name = Input::get('setting_name');
     $settings->setting_value = Input::get('setting_value');
     $settings->autoload = Input::get('autoload');
     Event::fire('backend.settings.save', array($settings));
     $settings->save();
     return Redirect::to('backend/settings/')->withMessage($this->notifyView(Lang::get('laracms::messages.settings_saved'), 'success'));
 }
开发者ID:basdog22,项目名称:laracms,代码行数:16,代码来源:LaraBackendController.php

示例4: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (ACL::checkUserPermission('settings.index') == false) {
         return Redirect::action('dashboard');
     }
     $settingsInfo = Settings::find($id);
     if (!empty($settingsInfo)) {
         $title = Lang::get('Edit Setting');
         $formOpen = Form::open(array('method' => 'post', 'id' => 'form-settings', 'class' => '', 'route' => array('settings.update', $id)));
         $formClose = Form::close();
         $data = array('title' => $title, 'formOpen' => $formOpen, 'formClose' => $formClose, 'settingsInfo' => $settingsInfo);
         return View::make('settings/edit', $data);
     } else {
         $message = 'Cannot find SettingsInfo';
         return Redirect::action('settings.index')->with('error', $message);
     }
 }
开发者ID:pacificcasinohotel,项目名称:pointsystem,代码行数:23,代码来源:SettingsController.php

示例5: getActivityDefaultValues

 /**
  * @param $activityId
  * @return array
  */
 public function getActivityDefaultValues($activityId)
 {
     return $this->activity->find($activityId)->default_field_values;
 }
开发者ID:younginnovations,项目名称:aidstream,代码行数:8,代码来源:ChangeActivityDefault.php

示例6: save_settings

 public function save_settings()
 {
     $settings = Settings::all();
     foreach ($settings as $setting) {
         if (Input::get($setting->id) != NULL) {
             $temp_setting = Settings::find($setting->id);
             $temp_setting->value = Input::get($setting->id);
             $temp_setting->save();
         }
     }
     return Redirect::to('/admin/settings?success=1');
 }
开发者ID:felipemarques8,项目名称:goentregas,代码行数:12,代码来源:AdminController.php

示例7: getCostingRecord

 public function getCostingRecord($costingDb, $quantity = 0)
 {
     App::uses('Settings', 'Model');
     App::uses('Customer', 'Model');
     //$costingDb = $this->Costing->findById($costingId);
     $exportDate = date('Y-m-d', time());
     $settingModel = new Settings();
     $settings = Hash::combine($settingModel->find("all"), '{n}.Settings.key', '{n}.Settings.val');
     $customerModel = new Customer();
     $customer = isset($costingDb['Product']['customer_id']) ? $customerModel->findById($costingDb['Product']['customer_id']) : array();
     $data = array();
     if (empty($quantity)) {
         $quantity = $costingDb['Costing']['quantity'];
     }
     //row 1
     $row = array();
     $row[0] = '';
     $row[1] = '';
     $row[2] = '';
     $row[3] = 'HAVUPACKAGE';
     $row[4] = '';
     $row[5] = '';
     $row[6] = '';
     $row[7] = '';
     $row[8] = 'COSTOFF';
     $data[] = $row;
     //row 2
     $row = array();
     $row[0] = '';
     $row[1] = 'CONG TY TNHH BAO BI GIAY HOANG VUONG';
     $data[] = $row;
     //row 3
     $data[] = array();
     //row 4
     $row = array();
     $row[0] = 'DATE (YYYY-MM-DD):';
     $row[1] = $exportDate;
     $row[2] = '';
     $row[3] = '';
     $row[4] = "QUOTATION  SHEET  No:";
     $data[] = $row;
     $strLine = '-------------------------------------------------------------------------------------------------------------------------------';
     //row 5
     $row = array();
     $row[0] = $strLine;
     $data[] = $row;
     //row 6
     $row = array();
     $row[0] = 'Customer:';
     $row[1] = '';
     $row[2] = isset($customer['Customer']['name']) ? $customer['Customer']['name'] : '';
     $row[3] = '';
     $row[4] = '';
     $row[5] = 'Product Specification:';
     $row[6] = '';
     $row[7] = isset($costingDb['Product']['specification']) ? $costingDb['Product']['specification'] : '';
     $data[] = $row;
     //row 7
     $data[] = array();
     //row 8
     $row = array();
     $row[0] = 'Model:';
     $row[1] = '';
     $row[2] = isset($costingDb['Product']['item_no']) ? $costingDb['Product']['item_no'] : '';
     $row[3] = '';
     $row[4] = '';
     $row[5] = 'Person-In-charged:';
     $row[6] = '';
     $row[7] = isset($costingDb['User']['display_name']) ? $costingDb['User']['display_name'] : '';
     $data[] = $row;
     //row 9
     $row = array();
     $row[0] = $strLine;
     $data[] = $row;
     //row 10
     $row = array();
     $row[0] = 'Length =';
     $row[1] = $costingDb['Costing']['spec_length'];
     $row[2] = 'cm';
     $row[3] = 'With =';
     $row[4] = $costingDb['Costing']['spec_width'];
     $row[5] = 'cm';
     $row[6] = '';
     $row[7] = 'Quantity:';
     $row[8] = $quantity;
     $data[] = $row;
     //row 11
     $row = array();
     $row[0] = $strLine;
     $data[] = $row;
     //row 12
     $row = array();
     $row[0] = '';
     $row[1] = '';
     $row[2] = '';
     $row[3] = '';
     $row[4] = '';
     $row[5] = '';
     $row[6] = 'Length(cm)';
     $row[7] = 'Width(cm)';
//.........这里部分代码省略.........
开发者ID:pdkhuong,项目名称:BBG,代码行数:101,代码来源:Costing.php

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Settings::find($id)->delete();
     return Redirect::to('settings')->with('success', 'Record deleted successfully');
 }
开发者ID:x4rMa,项目名称:Vehicle-Inspection-System,代码行数:11,代码来源:SettingsController.php


注:本文中的Settings::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。