CodeIgniter HMVC网址与Twig模板无法正常工作

时间:2016-08-19 02:33:58

标签: php codeigniter view twig hmvc

我有一个带有HMVC扩展名的CodeIgniter 3.1,我使用Twig作为模板引擎。

我的问题是我在模块内的视图中的所有网址都返回一个奇怪的值。

示例:

select id, substring_index(group_concat(city order by cnt desc separator '|'), '|', 1) as most_visited_city, max(cnt) as number_of_times_visited from (select p.id, c.city, count(*) as cnt from people p join cities c on p.id = c.people_id where p.image is null group by p.id, c.city ) pc group by id; 我从Module/views/admin_template.html.twig模块

中调用控制器
Dashboard

这应该是返回

<a href="{{ base_url() }}{{'dashboard/index'}}">

而是返回

http://mysite.dev/dashboard/index

1 个答案:

答案 0 :(得分:0)

我更改了<a href="{{ base_url() }}{{'dashboard/index'}}">

 <a href="{{ base_url }} {{ '/dashboard/index' }}">

现在它工作正常

相关问题