Understanding MVC URL pattern

All about creating websites!
Post Reply
User avatar
z3r0aCc3Ss
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 700
Joined: 23 Jun 2009, 16:00
14
Contact:

Understanding MVC URL pattern

Post by z3r0aCc3Ss »

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.
Beta tester for major RATs, all kinds of stealers and keyloggers.
Learning NMAP

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Understanding MVC URL pattern

Post by ayu »

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

Code: Select all

https://ellislab.com/codeigniter/user-guide/overview/mvc.html
Longer description of the URI patterns

Code: Select all

https://ellislab.com/codeigniter/user-guide/general/routing.html
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

Code: Select all

https://ellislab.com/codeigniter/user-guide/
"The best place to hide a tree, is in a forest"

Post Reply