CodeIgniter Forums
problems with the controller and view. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: problems with the controller and view. (/thread-25997.html)



problems with the controller and view. - El Forum - 01-03-2010

[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.


problems with the controller and view. - El Forum - 01-03-2010

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


problems with the controller and view. - El Forum - 01-03-2010

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


problems with the controller and view. - El Forum - 01-04-2010

[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!