Welcome Guest, Not a member yet? Register   Sign In
How does it know which page to load?
#5

(03-05-2015, 01:08 PM)lexxtoronto Wrote: Im just curious how does it know that the default value needs to be replaced? Since 'view' is taking an explicit argument $page='home' then normally it wouldnt work because about != home.

Well, 'view' is not really taking an explicit argument $page = 'home.' When you have a value assigned to a parameter in a function's declaration in PHP, that value is only assigned if the function is called with no argument. That 'home' is there only in case your call doesn't include a value to use instead.

That's actually PHP and not Codeigniter. http://www.tuxradar.com/practicalphp/4/15/5
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply


Messages In This Thread
RE: How does it know which page to load? - by RobertSF - 03-05-2015, 04:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB