本文整理汇总了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;
}
示例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'));
}
示例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'));
}
示例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);
}
}
示例5: getActivityDefaultValues
/**
* @param $activityId
* @return array
*/
public function getActivityDefaultValues($activityId)
{
return $this->activity->find($activityId)->default_field_values;
}
示例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');
}
示例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)';
//.........这里部分代码省略.........
示例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');
}