本文整理汇总了PHP中Configuration::populate方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::populate方法的具体用法?PHP Configuration::populate怎么用?PHP Configuration::populate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::populate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAll
public function getAll()
{
if (!isset($_SESSION['configuration'])) {
$configurationManager = new Configuration();
$configs = $configurationManager->populate();
$confTab = array();
foreach ($configs as $config) {
$this->confTab[$config->getKey()] = $config->getValue();
}
$_SESSION['configuration'] = serialize($this->confTab);
} else {
$this->confTab = unserialize($_SESSION['configuration']);
}
}
示例2: getAll
public function getAll()
{
if (!isset($_SESSION['configuration'])) {
$configurationManager = new Configuration();
$configs = $configurationManager->populate();
$confTab = array();
foreach ($configs as $config) {
$ns = 'conf';
$key = $config->getKey();
$infos = explode(':', $key);
if (count($infos) == 2) {
list($ns, $key) = $infos;
}
$this->confTab[$ns][$key] = $config->getValue();
}
$_SESSION['configuration'] = serialize($this->confTab);
} else {
$this->confTab = unserialize($_SESSION['configuration']);
}
}
示例3: preference_plugin_page
function preference_plugin_page()
{
global $myUser, $_;
if (isset($_['section']) && $_['section'] == 'preference' || !isset($_['section'])) {
if ($myUser != false) {
?>
<div class="span9 userBloc">
<h1>Préférence</h1>
<p>Gestion des préférences du programme</p>
<ul class="nav nav-tabs">
<li <?php
echo isset($_['block']) && $_['block'] == 'global' ? 'class="active"' : '';
?>
><a href="setting.php?section=preference&block=global"><i class="fa fa-angle-right"></i> Général</a></li>
<?php
Plugin::callHook("preference_menu", array());
?>
</ul>
<?php
if (isset($_['section']) && $_['section'] == 'preference' && @$_['block'] == 'global' || !isset($_['section'])) {
if ($myUser != false) {
?>
<div class="span9 userBloc">
<table class="table table-striped table-bordered" id="setting_table">
<tr><th>Clé</th><th>Valeur</th><tr>
<?php
$conf = new Configuration();
$confs = $conf->populate();
foreach ($confs as $value) {
$ns = 'conf';
$key = $value->getKey();
$infos = explode(':', $key);
if (count($infos) == 2) {
list($ns, $key) = $infos;
}
if ($ns != 'conf') {
continue;
}
echo '<tr><td>' . $key . '</td><td><input class="input-xxlarge" type="text" value="' . $value->getValue() . '" id="' . $value->getId() . '"></td></tr>';
}
?>
<tr><td colspan="2"><button type="submit" onclick="save_settings();" class="btn">Modifier</button></td></tr>
</table>
</div>
<?php
} else {
?>
<div id="main" class="wrapper clearfix">
<article>
<h3>Vous devez être connecté</h3>
</article>
</div>
<?php
}
}
Plugin::callHook("preference_content", array());
?>
</div>
<?php
} else {
?>
<div id="main" class="wrapper clearfix">
<article>
<h3>Vous devez être connecté</h3>
</article>
</div>
<?php
}
}
}