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


PHP Base_Controller::page方法代码示例

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


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

示例1: index

 public function index()
 {
     if ($this->input->post()) {
         $data['optional'] = $this->input->post('optional');
         $quiz_session_id = $this->quiz_session->insert($data);
         foreach ($this->input->post('answers') as $question_id => $answer) {
             unset($data);
             $data['quiz_session_id'] = $quiz_session_id;
             $data['question_id'] = $question_id;
             if (isset($answer['answer'])) {
                 // Dicertive
                 $data['answer'] = $answer['answer'];
                 $this->response->insert($data);
             } else {
                 // Multichoice
                 $data['choice_id'] = $answer['choice'];
                 $this->response->insert($data);
             }
         }
         exit;
     }
     $questions = $this->question->get_all();
     foreach ($questions as $key => $q) {
         $questions[$key]['choices'] = $this->choice->get_all('', array('question_id' => $q['id']));
         //$questions[$key]['type'] = $this->config->item('questions_type')[$q['type']];
     }
     $this->data['questions'] = $questions;
     $this->layout = $this->config->item('ci_my_admin_template_dir_quiz') . "includes/layout";
     $this->view = $this->config->item('ci_my_admin_template_dir_quiz') . "quiz_index";
     parent::page();
 }
开发者ID:thomasgroch,项目名称:quiz,代码行数:31,代码来源:Quiz.php

示例2: index

 public function index()
 {
     $this->data['respostas'] = $this->quiz_session->get_all();
     $this->data['questions'] = $this->question->get_all();
     $this->view = $this->config->item('ci_my_admin_template_dir_admin') . "dashboard";
     parent::page();
 }
开发者ID:thomasgroch,项目名称:quiz,代码行数:7,代码来源:Admin.php

示例3: index

 public function index()
 {
     $sessions = $this->quiz_session->get_all();
     $header = array();
     $header[] = 'Sessão';
     $header_cache = array();
     foreach ($sessions as $session) {
         $responses = $this->response->get_all('', array('quiz_session_id' => $session['id']));
         $row = array();
         $row[] = $session['id'];
         foreach ($responses as $response) {
             // Set table header
             if (!in_array($response['question_id'], $header_cache)) {
                 $question = $this->question->get($response['question_id']);
                 $header[] = $question->label;
                 $header_cache[] = $response['question_id'];
             }
             if (!empty($response['answer'])) {
                 // Dicertive
                 $row[] = $response['answer'];
             } elseif ($response['choice_id'] != NULL) {
                 // Multichoice
                 $choice = $this->choice->get($response['choice_id']);
                 $row[] = $choice->label;
             }
         }
         $row[] = brazilian_datetime($session['date_created']);
         $this->table->add_row($row);
     }
     $header[] = 'Data';
     $this->table->set_heading($header);
     $tmpl = array('table_open' => '<table class="table table-striped table-bordered table-hover" id="dataTables-example">');
     $this->table->set_template($tmpl);
     $table = $this->table->generate();
     $this->data['data']['sessions'] = $sessions;
     $this->data['data']['table'] = $table;
     $this->view = $this->config->item('ci_my_admin_template_dir_admin') . "results_index";
     parent::page();
 }
开发者ID:thomasgroch,项目名称:quiz,代码行数:39,代码来源:Results.php

示例4: view

 function view($id = NULL)
 {
     $this->element->get_by_id($id);
     if (!$this->element->exists() || !$this->element->can_view()) {
         $this->msg_error(lang('no_permission'));
         redirect($this->ctrlr_name);
     }
     $this->_set_title($this->element->__toString());
     $this->_add_menu('left', 'view', $id);
     parent::page();
 }
开发者ID:thomasgroch,项目名称:quiz,代码行数:11,代码来源:CRUD_Controller.php


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