Welcome Guest, Not a member yet? Register   Sign In
problems with the controller and view.
#1

[eluser]_SC_[/eluser]
Hi all,
I created a view like this:
Code:
echo ('<div id="miniatura4"> <a href="index.php/welcome/min/'.$record['id'].'">
<img > </div>');

that invokes the function min in my controller:

function min($IdCorrente){
....
$this-> load-> vars($data);
$this-> load-> view('template');
}

Min re-load my view.
Now, the problems is ,after the first time ,the link, rather than being:
Code:
...index.php/welcome/min/
indicates:
Code:
...index.php/welcome/min/index.php/welcome/min/

and continuing it always adds a index.php/welcome/min (my href wired)
and so I get:
Code:
..index.php/welcome/min/index.php/welcome/min/index.php/welcome/min
how can I fix this?

another thing, probably related to the first,
when i invoke a function in my controller, all href of my view add the segment of the function. So if in my view I have:
Code:
href="..index.php/welcome/min/
      href="..index.php/welcome/cat/
and i invoke the cat function, after returning in my view I have:
Code:
href="..index.php/welcome/min/index.php/welcome/cat/
      href="..index.php/welcome/cat/index.php/welcome/cat/
Instead the first time the view is correct..
probably have to change something in some configuration, but do not know where..

T.Y.
#2

[eluser]tomcode[/eluser]
use absolute URL's, see site_url() and anchor() in the User Guide
#3

[eluser]Colin Williams[/eluser]
I think you skipped the relative vs. absolute URLs/paths chapter in your quest to conquer the web dev world
#4

[eluser]_SC_[/eluser]
[quote author="Colin Williams" date="1262602624"]I think you skipped the relative vs. absolute URLs/paths chapter in your quest to conquer the web dev world[/quote]

LOL!
Ty, solved!




Theme © iAndrew 2016 - Forum software by © MyBB