这是应该工作的。(我冒昧地简化了您的数据库调用,使其需要更少的处理。
* If you want to move the view directory out of the application * directory, set the path to it here. The directory can be renamed * and relocated anywhere on your server. If blank, it will default * to the standard location inside your application directory. * If you do move this, ...
这是应该工作的。(我冒昧地简化了您的数据库调用,使其需要更少的处理。
public function index(){ $data['title'] = 'my title part 1'; $data['title'] .= 'my title part 2'; $data = $this->function1(); $data = $this->function2(); $data['end'] .= 'end of this block'; $data['main_content'] = 'buildingView'; $this->load->view('templates/...
->load->view('user_edit', $my_form); } else { // form has validated! do something! } form_dropdown() 函数采用一个数组,其设置如下: $键=> $值在我的例子中,键是国家/地区 ID,值是国家/地区名称。我的国家/地区数组开头有一对“0”=>“NONE”,因此用户无法选择一个。如果我想像您的情况...
$this->load->view('cwblogview'); } } Once you have created the controller, the URL for the view would be: Your-domain.com/index.php/blog/ Pass array from the controller to view Here’s the controller code below. You can paste it inside your controller file or could put it in the...
我在Linux上也遇到了同样的问题。路径是正确的,但用户(apache)没有访问该文件夹的权限,因此'is_dir...
we save order into the var to load the view with the param already selected */if($search_string){$filter_session_data['search_string_selected']=$search_string;}else{$search_string=$this->session->userdata('search_string_selected');}$data['search_string_selected']=$search_string;if($orde...
$this->load->view('welcome_message'); } } Setting Your Own Prefix To set your own sub-class prefix, open yourapplication/config/config.phpfile and look for this item: $config['subclass_prefix'] = 'MY_'; Please note that all native CodeIgniter libraries are prefixed withCI_so DO NOT...
Change this syntax from CodeIgniter 3, from$this->load->view(‘directory_name/file_name’);to returnview(‘directoryname/filename’);fromecho $this->load->view(‘file_name’);toecho view(‘fileName’); Remove all defined(‘BASEPATH’)OR exit(‘No direct script access allowed’); ...