本文整理汇总了PHP中Settings::get_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::get_all方法的具体用法?PHP Settings::get_all怎么用?PHP Settings::get_all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::get_all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settings
public function settings()
{
$settings = array();
$first = TRUE;
foreach ($this->settings->get_all() as $setting) {
$settings[] = array('id' => $setting->id(), 'title' => $setting->title, 'active' => $first, 'view' => $setting->view());
$first = FALSE;
}
return $settings;
}
示例2: get
static function get($option)
{
if (empty(static::$settings) === true) {
Settings::get_all();
if (empty(static::$settings) === false && key_exists($option, static::$settings)) {
return static::$settings[$option];
}
}
if (key_exists($option, static::$settings)) {
return static::$settings[$option];
}
}
示例3: _self_doc
/**
* Returns a PluginDoc array that PyroCMS uses
* to build the reference in the admin panel
*
* @return array
*/
public function _self_doc()
{
$info = array();
// dynamically build the array for the magic method __call
$settings = Settings::get_all();
ksort($settings);
foreach ($settings as $slug => $value) {
$info[$slug]['description'] = array('en' => 'Retrieve the value for setting ' . $slug . '.', 'br' => 'Recupera o valor da configuração "' . $slug . '".');
$info[$slug]['single'] = true;
$info[$slug]['double'] = false;
$info[$slug]['variables'] = '';
$info[$slug]['params'] = array();
}
return $info;
}
示例4: action_index
public function action_index()
{
$data['settings'] = Settings::get_all();
if (\Input::method() == 'POST') {
Controller_Settings::update(Input::Post());
$data['settings'] = Settings::get_all(true);
}
$data['blocked'] = $blacklist_item = Model_Blacklist::query()->get();
$keys = \Settings::Get('character_set');
if (empty($keys) === true) {
$keys = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
}
$random_length = \Settings::Get('random_url_length');
if (empty($random_length) === true) {
$random_length = 5;
}
$url_sample_space = DB::select(DB::expr('count(id) as count'))->from('urls')->where(DB::expr('char_length(short_url)'), $random_length)->limit(1)->execute()->as_array();
$data['urls_left'] = Controller_Admin::mathFact(strlen($keys)) / (Controller_Admin::mathFact(strlen($keys) - $random_length) * Controller_Admin::mathFact($random_length)) - $url_sample_space[0]['count'];
$this->template->content = View::Forge('admin/index', $data);
}
示例5: catch
/* Succes message instellen. */
$_SESSION['settings']['success'] = 'De settings zijn opgeslagen.';
/* Javascript gebruiken om de pagina te 'refreshen'. */
echo '<script>window.location = \'./operator_instellingen\';</script>';
/* Exit het script, zodat er direct geredirect wordt. */
exit;
} catch (Exception $e) {
/* Foutmelding gevangen, sla deze op. */
$errorMessage = $e->getMessage();
}
}
}
/* Probeer onderstaande. */
try {
/* Probeer alle settings op te halen. */
$settings = Settings::get_all();
} catch (Exception $e) {
/* Foutmelding gevangen, kijken of er al 1 bestaat. */
if (!empty($errorMessage)) {
/* Er bestaat al een foutmelding, dus voeg deze eraan toe. */
$errorMessage .= '<br />' . $e->getMessage();
} else {
/* Nog geen foutmelding, dus sla deze op. */
$errorMessage = $e->getMessage();
}
}
}
?>
<style>
.table input[type="text"] {