当前位置: 首页>>代码示例>>PHP>>正文


PHP N2Request::set方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:34,代码来源:Generator.php

示例2: setRequest

 public final function setRequest($controller, $action)
 {
     N2Request::set("nextendcontroller", $controller);
     N2Request::set("nextendaction", $action);
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:5,代码来源:type.php


注:本文中的N2Request::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。