How does it know which page to load? |
(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!
|
Messages In This Thread |
How does it know which page to load? - by lexxtoronto - 03-05-2015, 12:17 PM
RE: How does it know which page to load? - by obiron - 03-05-2015, 12:37 PM
RE: How does it know which page to load? - by lexxtoronto - 03-05-2015, 01:08 PM
RE: How does it know which page to load? - by RobertSF - 03-05-2015, 04:50 PM
RE: How does it know which page to load? - by CroNiX - 03-05-2015, 02:18 PM
RE: How does it know which page to load? - by lexxtoronto - 03-06-2015, 01:43 PM
RE: How does it know which page to load? - by RobertSF - 03-06-2015, 08:43 PM
|