本文整理汇总了PHP中N2Request::set方法的典型用法代码示例。如果您正苦于以下问题:PHP N2Request::set方法的具体用法?PHP N2Request::set怎么用?PHP N2Request::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类N2Request
的用法示例。
在下文中一共展示了N2Request::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEdit
public function actionEdit()
{
if ($this->validatePermission('smartslider_edit')) {
$generatorId = N2Request::getInt('generator_id');
$generatorModel = new N2SmartsliderGeneratorModel();
$generator = $generatorModel->get($generatorId);
if ($this->validateDatabase($generator)) {
$slidesModel = new N2SmartsliderSlidesModel();
$slides = $slidesModel->getAll(-1, 'OR generator_id = ' . $generator['id'] . '');
if (count($slides) > 0) {
$slide = $slides[0];
if (N2Request::getInt('save')) {
$request = new N2Data(N2Request::getVar('generator'));
$slideParams = new N2Data($slide['params'], true);
$slideParams->set('record-slides', $request->get('record-slides', 1));
$slidesModel->updateParams($slide['id'], $slideParams->toArray());
$request->un_set('record-slides');
$generatorModel->save($generatorId, $request->toArray());
N2SmartsliderSlidesModel::markChanged($slide['slider']);
N2Message::success(n2_('Generator updated and cache cleared.'));
$this->redirect(array("generator/edit", array("generator_id" => $generatorId)), 302, true);
}
N2Request::set('sliderid', $slide['slider']);
$this->addView("../../inline/_sliders", array("appObj" => $this), "sidebar");
$this->addView("edit", array("generatorModel" => $generatorModel, "generator" => $generator, "slide" => $slide));
$this->render();
} else {
$this->redirect(array("sliders/index"), 302, true);
}
} else {
$this->redirect(array("sliders/index"), 302, true);
}
}
}
示例2: setRequest
public final function setRequest($controller, $action)
{
N2Request::set("nextendcontroller", $controller);
N2Request::set("nextendaction", $action);
}