How to get base url in CodeIgniter 2.*

前端 未结 5 1186

In config.php

$config[\'base_url\'] = \'http://localhost/codeigniter/\';

In View



        
5条回答
  •  半阙折子戏
    2020-12-13 18:28

    You need to add url helper in config/autoload

    $autoload['helper'] = array('form', 'url', 'file', 'html'); <-- Like This
    

    Then you can use base_url or any kind of url.

提交回复
热议问题