【问题标题】:Page not recognised?页面无法识别?
【发布时间】:2014-05-08 16:34:29
【问题描述】:

当我尝试在浏览器中加载它时,控制器似乎没有识别我的视图页面。视图页面本身称为insertjob.php,控制器称为客户端,因此链接应为website_url/client/insertjob

我已将其上传到服务器并且主页可以正常工作,但即使链接正确,插入作业页面也不会加载。

控制器

public function addjobsform()
{
$this->load->helper('form');
$data['title']="Add a new job";
$this->load->view("insertjob", $data);
}

查看

<h1>Welcome to XYZ inc.</h1> 
<p>Find out everything you need to know about the XYZ company</p> 

<div id="nav"
<ul> 
<li><a href="<?php echo site_url('nav/home');?>">Home</a><li>
<li><a href="<?php echo site_url('client/insertjob');?>">Insert</a></li>
</ul>

型号

<?php

class cmodel extends CI_Model {

function __construct()
{
parent:: __construct();   
}

function getjob(){
$query = $this->db->get('client');
return $query->result();
}

}
function addjob($jobtype,$jobinfo)
{
    $newjob=array("jobtype"=>$jobtype,"jobinfo"=>$jobinfo);
    return $this->db->insert('client', $newjob);
}

}
?>

【问题讨论】:

  • 试试 website_url/index.php/client/addjobsform
  • 谢谢,工作正常,是函数名....谢谢
  • 我有答案

标签: php codeigniter view model


【解决方案1】:

你使用了错误的网址

试试

website_url/index.php/client/addjobsform

website_url/index.php/controller/controllerfunction

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    相关资源
    最近更新 更多