how to get base url in smarty codeigniter how to get base url in smarty codeigniter codeigniter codeigniter

how to get base url in smarty codeigniter


You made little typo on ";"

{base_url('styles/bootstrap/css/bootstrap-theme.min.css')}

note :

url_helper must be loaded before displaying template


you can use like this I didn't test this

{'styles/bootstrap/css/bootstrap-theme.min.css'|base_url}

or you can write php code inside template

{php}  $this->assign('my_url',base_url('styles/bootstrap/css/bootstrap-theme.min.css'));{/php}{$my_url}

see this http://www.smarty.net/docsv2/en/language.function.php.tpl


I have used this function for my controller in form action to redirect to my method it worked .

{base_url('my_controller/my_method')}