Codeigniter 組み込み関数を使用して、URL でいくつかの関数を使用でき_remap
ます。コントローラー内で次の関数を使用します。
public function _remap($method){
if ($method == 'project-name')
{
//display project1
}
elseif($method == 'project-name2')
{
//display project2
}
params を使用した別の例:
public function _remap($method, $params = array())
{
$method = 'process_'.$method;
if (method_exists($this, $method))
{
return call_user_func_array(array($this, $method), $params);
}
show_404();
}
$method
はfunction
URL にあります:
http://somesite.com/controller/function/brand_id/product_id
データベースからメソッドを抽出することで、さまざまなメソッドに対して同じことができます
ここを見てください:http://codeigniter.com/user_guide/general/controllers.html#remapping