As already mentioned, make sure there is no white space (spaces, tabs, new lines etc.) before the opening <?php
tag in your controller. If you have a closing ?>
tag, then this can be removed, as it can often cause issues with redirect
.
In this case, if you aren't concerned about having the function's name in the URL (this will not change the URL to show the function that you are calling (logotyp()
) in the URL, whereas the redirect
function would)/refreshing the page, then you could just call the relevant function directly in your index()
function:
public function index()
{
$this->logotyp();
}
For your second issue (CSS not loading); it is probably occuring because the link to its path is incorrect. Using the base_url
function from CodeIgniter's URL Helper
you can easily generate the correct path. I don't know where your CSS file(s) is located, but for this example I'll assume that, relative to the site root, it is here: assets/css/style.css
. Simply add the path relative to web root as so:
<link href="<?php echo base_url("assets/css/style.css"); ?>" type="text/css" rel="stylesheet">
link_tag() in the HTML Helper
can also help with the generation of stylesheet links.