Welcome Guest, Not a member yet? Register   Sign In
Site Design problem

I'm transitioning an existing site into Code Igniter, and I've hit a snag.

In my original, I have my site laid out as such (for example):

<root of site>

and in my index.html, would be something like
<img src="./images/myimage.jpg">

How do I do this in code igniter? I have a view controller setup, with an images subdirectory in the views folder, and try and add it the same way but it doesnt show.

Leave the css and image files in the web root.
Then link them using absolute paths:
<img src="/images/some_pic.png" />

ah. so if i'm using a wysiwyg, I'm going to have to have 2 copies, one in the application folder to design, and then one in the root to actaully see them?

[quote author="veamon" date="1236397436"]so if i’m using a wysiwyg[/quote]
What are you doing?
Are you using an editor like TinyMCE to edit the contents?
Why should you need two copies?

Well, I'm using dreamweaver, and with the views being buried in application/system/whatever/whatever, and the main index.php being at the web root....thats why. I'm not going to have ....../images in my controller while I'm designing.


Nevermind. I found I can just have my view in the root dir, and have my controller access it by /controllername.

Never mind, this doesnt work.

Anyone have any ideas? Am I going to have to echo full paths in my views folder to my images one that is in the root directory?

I tried moving a view outside and putting it in the root, and then having my controller load base_url().view, but I get a "page cannot be loaded".

Does this work for you?

directory structure
    -> index.php

    -> images/
        -> some_image.png

    -> css/
        -> some_style.css

    -> system
        -> application
            -> views/
                -> some_view.php

            -> controllers/
                -> some_controller.php

class Some_controller extends Controller {
    function index()

        &lt;title&gt;some title&lt;/title&gt;
        &lt;link rel="stylesheet" href="/css/some_style.cs" type="text/css" /&gt;
        <img src="/images/some_image.png" />

Theme © iAndrew 2016 - Forum software by © MyBB