Welcome Guest, Not a member yet? Register   Sign In
Problem with CSS, JS, and IMG directory paths
#12

[eluser]noland[/eluser]
Hi all;

my own way to workaround this (allowing dreamweaver to preview the webpages and working ok when executed is described in the following lines.

in the controller I use this code (based on the multiple views post I've seen in this forum):

CONTROLLER

Code:
//we get the webpage code and replace the absolute for my own route
//we write true at the end, so we have the webpage html returned to the 'mywebpage' variable
$mywebpage = $this->load->view('ok', $data,  true);    
        
//here we replace relative routes with my real and good routes (sub folder inside my httproot)
$mywebpage = str_replace("../../../" , "/CodeIgniter_1.5.4/", $mywebpage);                
        
//here we show the page in the screen, with the routes changed correctly
echo $mywebpage;

and now the view code
Code:
<body>
<p><img src="../../../img/advertencia.gif" width="16" height="13"><img src="../../../img/advertencia.gif" width="16" height="13"></p>

as you can see, I use ../../../ to allow dreamweaver to reach ok the photo, but in the controller, i replace that for correct view purposes.

Works pertfectly!

And part II, when the time comes to show an include correctly (it's a little bit absurd this code, but works perfectly Smile )

Code:
&lt;?php
    if (true != true)    {
?&gt;
  &lt;?php
    include("../../../include/menu.php");    
?&gt;
  &lt;?php
    }    else    {    include("include/menu.php");        }
?&gt;

it allows dreamweaver to show me the menu correctly.

In fact this condition is always conducted; the false "if" is only for dreamweaver correctly view purposes.

should be very easy for everyone to convert this process in a processing class for dreamweaver and other IDES Smile

Hope this help! it helps me a lot!!! Smile


Messages In This Thread
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-02-2007, 07:30 PM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-03-2007, 01:55 AM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-03-2007, 05:03 AM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-04-2007, 06:30 PM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-04-2007, 06:47 PM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-04-2007, 09:38 PM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-04-2007, 11:35 PM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-05-2007, 01:35 AM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-05-2007, 02:40 AM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-05-2007, 05:28 AM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-05-2007, 07:05 AM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-05-2007, 03:51 PM
Problem with CSS, JS, and IMG directory paths - by El Forum - 11-25-2007, 12:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB