0
我在gocart codeigniter中遇到了一些問題。我創建了一個名爲的前端控制器裝飾 然後動作命名爲產品並傳遞子彈的行動。如何在gocart中創建前端控制器和動作
以下是控制器
<?php
class Decorate extends Front_Controller {
function __construct()
{
parent::__construct();
//make sure we're not always behind ssl
remove_ssl();
$this->load->model(array('Decorate_model'));
$this->lang->load('decorate');
}
function index()
{
$data['page_title'] = lang('decorates');
$data['decorates'] = $this->Decorate_model->get_front_all_decorates();
$this->load->view('decorate_home',$data);
}
/* Single Decorate */
function products($decorate_slug)
{
$data['page_title'] = lang('decorates');
}
}
?>
的代碼,但是當我運行網址www.abc.com/gocart/index.php/decorate/products/decorate-1
則顯示404錯誤。我不知道如何在gocart中創建動作。
您沒有在'products'功能中查看。添加'$ this-> index();'你的動作代碼後 – Bora
我只是檢查它是否會工作或不。如果我使用任何視圖,那麼也不工作 –
添加'$ this-> load-> view( 'decorate_home');'產品'功能。你再犯錯嗎? – Bora