本文整理汇总了PHP中Web::moduleConf方法的典型用法代码示例。如果您正苦于以下问题:PHP Web::moduleConf方法的具体用法?PHP Web::moduleConf怎么用?PHP Web::moduleConf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Web
的用法示例。
在下文中一共展示了Web::moduleConf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_POST
function edit_POST(Web $w)
{
$p = $w->pathMatch("id");
$processor_id = $p["id"];
// Break the selected processor up into module and class
$processor_class = $w->request("processor_class");
$processor_expl = explode(".", $processor_class);
// Make sure we only have two values
if (count($processor_expl) !== 2) {
$w->error("Missing Processor values", "/channels/listprocessors");
exit;
}
// make sure the selected class exists in config
if (!in_array($processor_expl[1], $w->moduleConf($processor_expl[0], "processors"))) {
$w->error("Could not find processor in config", "/channels/listprocessors");
exit;
}
$processor_object = $processor_id ? $w->Channel->getProcessor($processor_id) : new ChannelProcessor($w);
$processor_object->fill($_POST);
$processor_object->channel_id = $w->request("channel_id");
$processor_object->module = $processor_expl[0];
$processor_object->class = $processor_expl[1];
$processor_object->insertOrUpdate();
$w->msg("Processor " . ($processor_id ? "updated" : "created"), "/channels/listprocessors");
}