Welcome Guest, Not a member yet? Register   Sign In
hiding controller from url
#3

[eluser]jedd[/eluser]
[quote author="bhbutter123" date="1260774045"]right now some of my urls look like http://domain.com/page/pagename, is it possible to make it look like http://domain.com/pagename where pagename is still a method in the controller page? Are there any problems or disadvantages implementing this?[/quote]

In this instance, Page is the name of your Controller, and pagename is the method in your controller, yes?

The answer is - yes, you can do what you are wanting to do here, using routes. (Read about them in the user guide.)

The answer to your second question is a bit more complex - the 'qualified' bit attached to the previous 'yes'. It means that you need to correlate your URL's to various controller/method pairings, and that can sometimes make things more complicated than it would be if you just stuck with the controller/method/param1/param2/... style of URL.

Perhaps you just need to re-think your controller and method names - if you stick with the controller = entity or noun, and method = activity or verb - you might find that your URL's make more sense.


Messages In This Thread
hiding controller from url - by El Forum - 12-13-2009, 07:00 PM
hiding controller from url - by El Forum - 12-13-2009, 07:08 PM
hiding controller from url - by El Forum - 12-13-2009, 07:10 PM
hiding controller from url - by El Forum - 12-13-2009, 07:16 PM
hiding controller from url - by El Forum - 12-13-2009, 07:29 PM
hiding controller from url - by El Forum - 12-13-2009, 07:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB