本文整理汇总了PHP中app\Setting::getSettingByName方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getSettingByName方法的具体用法?PHP Setting::getSettingByName怎么用?PHP Setting::getSettingByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Setting
的用法示例。
在下文中一共展示了Setting::getSettingByName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDatabaseArgument
function getDatabaseArgument($name, $key, $category = 'ViewArguments')
{
try {
return Setting::getSettingByName($name, $category)->{$key};
} catch (Exception $ex) {
return '#ERROR';
}
}
示例2: initSetting
protected function initSetting(&$target, $name, $category, $index, &$request)
{
try {
$item = Setting::getSettingByName($name, $category);
$target = $item->{$index};
} catch (Exception $ex) {
$this->AdminUserUAL = $this->SuperUserUAL;
$trace = $category . '::' . $name . '->' . $index;
if (!session('error')) {
$request->session()->flash('error', '<a href="' . action($this->SettingRoot . '@index') . '#' . $category . '" class="alert-link">Invalid setting! {' . $trace . '} [SuperUser Mode]</a>');
}
}
}
示例3: preRegister
public function preRegister(Request $request)
{
try {
try {
Setting::getSettingByName('Administrator', 'User')->MaxUAL;
} catch (Exception $ex) {
throw new Exception('disabled');
}
if (Setting::getSettingByName('Register', 'Auth')->Enabled == true) {
return $this->postRegister($request);
} else {
throw new Exception('disabled');
}
} catch (Exception $ex) {
if ($ex->getMessage() != 'disabled') {
return redirect($request->url());
} else {
return redirect($request->url())->withErrors("Sorry! The register module is disabled.");
}
}
}