我的网址是:如何在codeigniter中呈现视图时传递数据或数据数组?
http://localhost/CodeIgniterCms/admin/dashboard/otherpages/123
其中,
笨CMS
- admin
-- dashboard (the controller)
--- otherpages (Method)
控制器代码
public function otherpages($somedata) {
$this->render('admin/second_view',$somedata);
}
守则second_view.php
<pre>
<div class="container">
<?php echo $somedata;?>
</div>
</pre>
但它抛出错误
无法加载所需的文件:你otherpages
函数内部管理/ 123.php
你有什么特别的路由?因为默认是'localhost/class/function/data /',你的url不完全对应它。 – Wold
是的,我使用.htaccess删除了index.php,并通过在route.php中声明route config来路由我的管理应用程序和公共应用程序。 –
您能否包含相关的路由信息?这将有助于回答这个问题。 – Wold