load view when a url is clicked |
[eluser]codecombustor[/eluser]
i am a CI newbie.... i'd like to know ---how to load view when a url is clicked ??---
[eluser]terry101[/eluser]
this is a question i don't know my self. 1 way of doing it is <a href="url"> and directing it to your view page but i don't think this is the correct approach.
[eluser]codecombustor[/eluser]
how about using javascript onclick when url is selected....is it a standard way to navigate pages
[eluser]terry101[/eluser]
yea thats another method too but i believe when using codeigniter you can use the url helper and redirect the page that way. I haven't tried my self yet so i'm not 100% sure. i'm as new as you are in CI
[eluser]jblack199[/eluser]
when a link is clicked, your link would be something like... http://www.domain.com/about/ or something like that... you'd then have a controller for help and load your view via the controller by using $this->load->view('about');
[eluser]terry101[/eluser]
ooo so for example say the controller was called "about" and the function was "go". so i would do href = http://www.domain.com/about/go/ ?
[eluser]CodeIgniteMe[/eluser]
a better approach is to use the url helper for that. for example, you need a link for the about/go URI, you will just have to do Code: <?php This is recommended so that your application will be portable in the event that you changed your domain or server. |
Welcome Guest, Not a member yet? Register Sign In |