CodeIgniter Forums
base_url() function to load css doesn't work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: base_url() function to load css doesn't work (/showthread.php?tid=49241)

Pages: 1 2


base_url() function to load css doesn't work - El Forum - 02-12-2012

[eluser]InsiteFX[/eluser]
Yes! Unless you use a tample and pass everything to it.



base_url() function to load css doesn't work - El Forum - 02-12-2012

[eluser]mazzy[/eluser]
[quote author="InsiteFX" date="1329095092"]Yes! Unless you use a tample and pass everything to it.
[/quote]

So the header of my page has to be the same for all page in my project?


base_url() function to load css doesn't work - El Forum - 02-12-2012

[eluser]mazzy[/eluser]
anyone respond to my second question...why when i change page from login to index the url remain always login?


base_url() function to load css doesn't work - El Forum - 02-12-2012

[eluser]InsiteFX[/eluser]
./application/views/template.php
Code:
<!doctype html>
&lt;html lang="en"&gt;

&lt;head&gt;

    &lt;meta charset="utf-8" /&gt;
    &lt;meta http-equiv="content-type" content="text/html;charset=utf-8" /&gt;

    &lt;title&gt;The Template Example.&lt;/title&gt;

    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;

    &lt;!-- Your styles --&gt;
    &lt;link rel="stylesheet" href="assets/css/styles.css" type="text/css" media="screen" /&gt;

&lt;/head&gt;

&lt;body&gt;

    &lt;?php echo $title; ?&gt;

    &lt;?php $this->load->view($main); ?&gt;

&lt;/body&gt;

&lt;/html&gt;

in your controller
Code:
$data['title'] = 'Template Test';
$data['main']  = 'view_file_name_to_load';

$this->load->vars($data);
$this->load->view('template');

Because it must be calling the login controller