本文整理汇总了PHP中Setting::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::all方法的具体用法?PHP Setting::all怎么用?PHP Setting::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$settings = Setting::all();
$suspects = Suspect::all();
$users = User::orderBy('username')->paginate(self::$per_page);
return View::make('settings.index', ['settings' => $settings, 'users' => $users, 'suspects' => $suspects]);
}
示例2: index
/**
* Display a listing of settings
*
* @return Response
*/
public function index()
{
$settings = Setting::all();
$shopsettings = Shopsetting::all();
$receiptsettings = Receiptsetting::all();
return View::make('settings.index', compact('settings', 'shopsettings', 'receiptsettings'));
}
示例3: getIndex
/**
* Show a list of all the comment posts.
*
* @return View
*/
public function getIndex()
{
View::share('settings', Setting::all());
// Title
$title = Lang::get('admin/settings/title.title');
// Show the page
return View::make('admin/settings/index', compact('comments', 'title'));
}
示例4: obtain
public static function obtain()
{
$configs = Setting::all();
$result = array();
foreach ($configs as $item) {
$result[$item->setting] = $item->value;
}
return $result;
}
示例5: __construct
public function __construct()
{
parent::__construct();
$users = User::orderBy('username')->paginate(self::$per_page);
$this->features = ['entries', 'logbooks', 'tasks', 'attachments', 'evidences', 'exports', 'cipher'];
View::share('users', $users);
View::share('settings', Setting::all());
View::share('suspects', Suspect::all());
View::share('features', $this->features);
}
示例6: __construct
public function __construct()
{
$this->data['setting'] = Setting::all()->first();
if (!isset($this->data['setting']) && count($this->data['setting']) == 0) {
die('Database not uploaded.Please Upload the database');
}
if (count($this->data['setting'])) {
}
$this->data['loggedAdmin'] = Auth::admin()->get();
$this->data['pending_applications'] = Attendance::where('application_status', '=', 'pending')->get();
}
示例7: __construct
public function __construct()
{
parent::__construct();
$users = User::orderBy('username')->paginate(self::$per_page);
$legals = Legal::orderBy('id')->paginate(self::$per_page);
$this->features = ['entries', 'logbooks', 'tasks', 'attachments', 'evidences', 'exports', 'tools'];
$this->export_features = ['ex_title', 'ex_customer', 'ex_date', 'ex_version', 'ex_disclaimer', 'ex_pdf_sh_evidences', 'ex_pdf_sh_coc', 'ex_pdf_sh_attachments', 'ex_pdf_sh_suspects', 'ex_pdf_sh_legals', 'ex_html_sh_evidences', 'ex_html_sh_coc', 'ex_html_sh_attachments', 'ex_html_sh_suspects', 'ex_html_sh_legals'];
View::share('users', $users);
View::share('settings', Setting::all());
View::share('suspects', Suspect::all());
View::share('features', $this->features);
View::share('legals', $legals);
}
示例8: getSettings
/**
* Get settings from DB.
*
* @return array
*/
public function getSettings()
{
global $data;
global $settings;
$rawSettings = Setting::all();
$settings = array();
foreach ($rawSettings as $key => $data) {
if ($data['type'] == 'array') {
$data['value'] = json_decode($data['value']);
}
$settings[$data['code']] = $data['value'];
}
}
示例9: loadConstants
public function loadConstants()
{
if (!($settings = Cache::read('settings', 'settings'))) {
App::import('Model', 'Settings.Setting');
$setting = new Setting();
$settings = $setting->all();
Cache::write('settings', $settings, 'settings');
}
for ($i = sizeof($settings) - 1; $i >= 0; $i--) {
$constant = $this->constantName(array($settings[$i]['Setting']['plugin'], $settings[$i]['Setting']['controller'], $settings[$i]['Setting']['action'], $settings[$i]['Setting']['setting']));
if (defined($constant)) {
continue;
}
define($constant, $settings[$i]['Setting']['value']);
}
}
示例10: post_view
public function post_view()
{
if (!cmsHelper::isCurrentUserAllowedToPerform('settings')) {
return;
}
Input::flash();
//Add rules here
$rules = array('articlelimit' => 'required', 'articlesize' => 'required', 'commentsize' => 'required', 'convertemotions' => 'required', 'maintenance' => 'required', 'textboxrows' => 'required', 'unregistercomments' => 'required');
//Get all inputs fields
$input = Input::all();
//Apply validaiton rules
$validation = Validator::make($input, $rules);
if ($validation->fails()) {
return Redirect::to("/admin/settings/view")->with_errors($validation);
}
$settings = Setting::all();
foreach ($settings as $setting) {
$setting->value = Input::get($setting->keyname);
$setting->save();
}
Input::flush();
return Redirect::to("/admin/settings/view")->with("successmessage", "Settings updated");
}
示例11: array
<?php
/**
* Created by PhpStorm.
* User: rahman
* Date: 13/10/14
* Time: 14:10
*/
$list = array('log_file' => 'log_file', 'domain_limit' => '3');
$format = function (&$list, $keys, $val) use(&$format) {
$keys ? $format($list[array_shift($keys)], $keys, $val) : ($list = $val);
};
if (Schema::hasTable('settings')) {
foreach (Setting::all() as $setting) {
$format($list, explode('.', $setting->name), $setting->value);
}
}
return $list;
示例12: getIndex
/**
* Show a list of all the comment posts.
*
* @return View
*/
public function getIndex()
{
$settings = Setting::all();
$title = Lang::get('admin/settings/title.title');
return Theme::make('admin/settings/index', compact('comments', 'title', 'settings'));
}
示例13: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return Setting::all();
}
示例14:
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
if ($app = Setting::all()) {
Route::get('/', 'HomeController@index');
Route::get('/adopt', 'AdoptController@view');
//Admin
Route::get('/admin', 'AdminController@view');
Route::post('/admin', 'AdminController@login');
Route::get('/admin/register', 'AdminController@getreg');
Route::post('/admin/register', 'AdminController@postreg');
//General Pages
Route::get('/{slug}', 'PageController@view');
} else {
Route::get('*', 'InstallController@view');
}
示例15: edit
/**
* Show the form for editing the specified Admin.
*/
public function edit()
{
$this->data['notificationSettingActive'] = 'active';
$this->data['setting'] = Setting::all()->first();
return View::make('admin.notificationSettings.edit', $this->data);
}