Dear all,
I am actually starting to work in CodeIgniter. Got confused in understanding how URL's work, written and navigation.
Any links or articles will be useful.
Understanding MVC URL pattern
- z3r0aCc3Ss
- Fame ! Where are the chicks?!
- Posts: 700
- Joined: 23 Jun 2009, 16:00
- 14
- Contact:
Understanding MVC URL pattern
Beta tester for major RATs, all kinds of stealers and keyloggers.
Learning NMAP
Learning NMAP
Re: Understanding MVC URL pattern
Generally you can think that the URL pattern in MVC is http://domain/controller/action/data" onclick="window.open(this.href);return false;.
So if you wanted to read news with id one, it could look like http://domain/news/read/1" onclick="window.open(this.href);return false;.
It would then go into the controller called news, which in normal cases would be a file called "news.php" that contains the function "read".
The id 1 is then passed to the function "read".
Of course you can modify this and have longer URLs with more parameters if you want.
In CodeIgniter you would do this in the route configuration if I remember correctly.
Short MVC description
Longer description of the URI patterns
I recommend using the user guide for any of your further questions.
It's a really great guide and it's what I used when I started using CI
So if you wanted to read news with id one, it could look like http://domain/news/read/1" onclick="window.open(this.href);return false;.
It would then go into the controller called news, which in normal cases would be a file called "news.php" that contains the function "read".
The id 1 is then passed to the function "read".
Of course you can modify this and have longer URLs with more parameters if you want.
In CodeIgniter you would do this in the route configuration if I remember correctly.
Short MVC description
Code: Select all
https://ellislab.com/codeigniter/user-guide/overview/mvc.html
Code: Select all
https://ellislab.com/codeigniter/user-guide/general/routing.html
It's a really great guide and it's what I used when I started using CI
Code: Select all
https://ellislab.com/codeigniter/user-guide/
"The best place to hide a tree, is in a forest"