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


PHP Controller::render方法代码示例

本文整理汇总了PHP中Controller::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::render方法的具体用法?PHP Controller::render怎么用?PHP Controller::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Controller的用法示例。


在下文中一共展示了Controller::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: signupAction

 public function signupAction()
 {
     $con = new Controller();
     $reg = new SignupValidation();
     $user = new UserDetails();
     if ($reg->validate() === true) {
         if ($user->insertUser() === true && $user->insertUserMobile() === true) {
             $con->render('userPage');
         } else {
             $con->render("fail");
         }
     }
 }
开发者ID:kapsi44,项目名称:phpTraining,代码行数:13,代码来源:SignupController.php

示例2: startup

 public function startup(Controller $controller)
 {
     if (!isset($controller->request->params['named']['CakeUILocalStorageName'])) {
         return;
     }
     $options = $controller->request->data['CakeUILocalStorage'];
     $model = $options['model'];
     if ($controller->request->params['named']['CakeUIOperation'] == 1) {
         //Display modal window
         if (isset($controller->request->data[$model])) {
             $data[$model] = $controller->request->data[$model][$controller->request->params['named']["CakeUIRowId"]];
             $controller->request->data = $data;
             $controller->request->data['CakeUITemp']['key'] = $controller->request->params['named']["CakeUIRowId"];
         }
         $controller->set(compact('options'));
         // $controller->set("cakeUICookie",$controller->request->params['named']["CakeUICookie"]);
         $controller->set("CakeUILocalStorageName", $controller->request->params['named']['CakeUILocalStorageName']);
         echo $controller->render($options["element"]);
         die;
     } else {
         if ($controller->request->params['named']['CakeUIOperation'] == 2) {
             //Add or update
             $controller->set(compact('options'));
             $controller->set("CakeUILocalStorageName", $controller->request->params['named']['CakeUILocalStorageName']);
             if ($this->model->{$model}->saveAll($controller->request->data, array('validate' => 'only'))) {
                 $controller->set('requestData', $controller->request->data);
                 echo $controller->render($options["return_element"]);
             } else {
                 $controller->Session->setFlash(__('Não foi possível adicionar este item'), 'default', array('class' => 'alert alert-danger'), 'modalMsg');
                 echo $controller->render($options["element"]);
             }
             die;
         } else {
             if ($controller->request->params['named']['CakeUIOperation'] == 3) {
                 //Delete
                 $id = $controller->request->params['named']["CakeUIRecordId"];
                 $this->model->{$model}->id = $id;
                 if (!$this->model->{$model}->exists()) {
                     throw new NotFoundException(__('Item inválido 1'));
                 }
                 if ($this->model->{$model}->delete($id, true)) {
                     die;
                 }
                 throw new NotFoundException(__('Item inválido 2'));
             }
         }
     }
 }
开发者ID:piotr0beschel,项目名称:CakeUI,代码行数:48,代码来源:childFormComponent.php

示例3: render

 protected function render($template = null, $direct = false)
 {
     if ($template) {
         $template = "admin/" . $template;
     }
     parent::render($template, $direct);
 }
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:7,代码来源:admin.controller.php

示例4: errorHandler

function errorHandler($errno, $errstr, $errfile, $errline)
{
    if (!(error_reporting() & $errno)) {
        // This error code is not included in error_reporting
        return;
    }
    switch ($errno) {
        case E_USER_ERROR:
            $error = "<b>My ERROR</b> [{$errno}] {$errstr}<br />\n\n                  Fatal error on line {$errline} in file {$errfile}\n                  , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
            echo $error;
            senderror($error);
            echo 'Aborting...<br />\\n';
            exit(1);
            break;
        default:
            $error = "Unknown error type: [{$errno}] \"{$errstr}\" in file \"{$errfile}\" on line {$errline}<br />\n";
            senderror($error);
            Controller::render('500');
            Controller::finish();
            //echo 'Aborting...<br />\n';
            exit(1);
            break;
    }
    /* Don't execute PHP internal error handler */
    return true;
}
开发者ID:davidliuliuliu,项目名称:sublite,代码行数:26,代码来源:error.php

示例5: update

 public function update($id)
 {
     if (parent::auth()) {
         if ($_SESSION['id'] == $id) {
             $user = User::find($id);
             if ($_POST) {
                 if ($_FILES['picture']) {
                     parent::uploadImage($_FILES['picture'], 'user');
                 }
                 try {
                     $user->update_attributes($_POST);
                     $_SESSION['username'] = $_POST['username'];
                     parent::redirect('site/index');
                 } catch (Exception $e) {
                     if (strstr($e->getMessage(), 'Duplicate entry') == true) {
                         $error = 'Username or Email Has Been Previously Registered';
                     }
                 }
             }
             parent::setHeader('default');
             parent::render('user/update', array('user' => $user, 'error' => isset($error) ? $error : ''));
             parent::setFooter('default');
         } else {
             parent::redirect('site/index');
         }
     } else {
         parent::redirect('site/index');
     }
 }
开发者ID:onuraltinsoy,项目名称:crescendo,代码行数:29,代码来源:UserController.php

示例6: errorHandler

function errorHandler($errno, $errstr, $errfile, $errline)
{
    if (!(error_reporting() & $errno)) {
        // This error code is not included in error_reporting
        return;
    }
    function senderror($error)
    {
        $session = $_SESSION;
        unset($session['pass']);
        $m = array2str(array('errormsg' => $error, 'session' => array2str($session, " &nbsp; &nbsp; %s = '%s'"), 'server' => array2str($_SERVER, " &nbsp; &nbsp; %s = '%s'"), 'request' => array2str($_REQUEST, " &nbsp; &nbsp; %s = '%s'")));
        sendgmail(array('tony.jiang@yale.edu', 'qingyang.chen@gmail.com'), "info@sublite.net", 'SubLite Error Report', $m);
        //echo "Error report sent!<br />\n";
    }
    switch ($errno) {
        case E_USER_ERROR:
            $error = "<b>My ERROR</b> [{$errno}] {$errstr}<br />\n\n                  Fatal error on line {$errline} in file {$errfile}\n                  , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
            echo $error;
            senderror($error);
            echo 'Aborting...<br />\\n';
            exit(1);
            break;
        default:
            $error = "Unknown error type: [{$errno}] \"{$errstr}\" in file \"{$errfile}\" on line {$errline}<br />\n";
            Controller::render('500');
            Controller::finish();
            senderror($error);
            //echo 'Aborting...<br />\n';
            exit(1);
            break;
    }
    /* Don't execute PHP internal error handler */
    return true;
}
开发者ID:edwardshe,项目名称:sublite-1,代码行数:34,代码来源:error.php

示例7: ver_postulaciones

 public function ver_postulaciones()
 {
     $id_oferta = $_GET['id_oferta'];
     $sql = 'SELECT * FROM tb_postulaciones_itpeople WHERE id_oferta = ' . $id_oferta;
     $data = array('id_oferta' => $id_oferta, 'titulo' => get_the_title($id_oferta), 'postulaciones' => parent::model('Model_Postulacion')->get_custom($sql));
     parent::render('ver_postulaciones', $data);
 }
开发者ID:pqzada,项目名称:wp-test,代码行数:7,代码来源:Postulacion.php

示例8: render

 public function render()
 {
     //if we have a layout - should get more specific, if we have an html master layout
     if ($this->layout_view) {
         $this->prepUI();
     }
     return parent::render();
 }
开发者ID:xdev,项目名称:blackbird,代码行数:8,代码来源:_Controller.php

示例9: render

 protected function render()
 {
     if (Front::$IS_OC2) {
         return $this->load->view($this->blog_template, $this->data);
     }
     $this->template = $this->blog_template;
     return parent::render();
 }
开发者ID:erickacevedor,项目名称:Opencart----Journal,代码行数:8,代码来源:blog.php

示例10: error

 function error($message)
 {
     header("HTTP/1.0 404 Not Found");
     $controller = new Controller($this->request);
     $controller->set('message', $message);
     $controller->render('/errors/404');
     die;
 }
开发者ID:IAntoineCI,项目名称:WebProject,代码行数:8,代码来源:Dispatcher.php

示例11: renderView

 private function renderView($template)
 {
     if (Front::$IS_OC2) {
         return $this->load->view($template, $this->data);
     }
     $this->template = $template;
     return parent::render();
 }
开发者ID:bgabor,项目名称:RenaniaOpencart,代码行数:8,代码来源:checkout.php

示例12: renderJSON

 protected function renderJSON($json)
 {
     Configure::write('debug', 0);
     $this->layout = null;
     $this->set('json', $json);
     $file = LAYOUTS . 'json' . $this->ext;
     return parent::render(null, null, $file);
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:8,代码来源:app_controller.php

示例13: render

 /**
  * Extends parent method.
  * Call renderPartial() instead of render() on ajax request.
  *
  * @param  $view
  * @param null $data
  * @param bool $return
  */
 public function render($view, $data = null, $return = false)
 {
     if (Yii::app()->request->isAjaxRequest === true) {
         parent::renderPartial($view, $data, $return, false);
     } else {
         parent::render($view, $data, $return);
     }
 }
开发者ID:Aplay,项目名称:myhistorypark_site,代码行数:16,代码来源:SAdminController.php

示例14: init

 public function init()
 {
     $current_route = Router::find_route();
     if ($current_route) {
         call_user_func($current_route->controller . 'Controller::' . $current_route->action);
     } else {
         Controller::render('404');
     }
 }
开发者ID:KirillDmitrievich,项目名称:php-test-app,代码行数:9,代码来源:router.php

示例15: renderView

 public function renderView($path, $vars = array())
 {
     // Create empty controller and inject services to it
     $controller = new Controller();
     $controller->setServiceContainer($this->services);
     // Create and display the response
     $response = $controller->render($path, $vars);
     echo $response->getContent() . "\n";
 }
开发者ID:migumuno,项目名称:obesity,代码行数:9,代码来源:TemplateInterface.php


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