MVC Question |
[eluser]codeman[/eluser]
Hi Guys, When you say that Code-Igniter uses the MVC approach and calls things only when needed makes it faster and less bulky Does that mean when i When i use this http://localhost/index.php/blog/name - it only performs name(), or comment() or index(). It does not load the whole blog page? Is this true? Does it load the whole page? if yes then what you mean by loading things when needed? Code: <?php
[eluser]Thorpe Obazee[/eluser]
What do you mean by 'not load the whole blog page'? Code: http://localhost/index.php/blog/name Loading things when needed is because you can load libraries and helpers like, the cart, ftp, image manilapulation, etc as your are executing via $this->load. That's probably one of the reasons why it's so fast. less automagic unlike 'Cake'.
[eluser]NogDog[/eluser]
The blog.php controller file would be included, so if that's what you mean by "loaded", then yes, it is "loaded"; but only the __construct() and name() methods would be executed (unless either of those methods executed other methods).
[eluser]NogDog[/eluser]
[quote author="bargainph" date="1240899925"]OT: Hmm.. 2 dogs one page :p[/quote] Wanna make puppies? (Actually, since Noggin is neutered, that may be a bit difficult regardless of whether or not your dog is female. :bug: )
[eluser]Thorpe Obazee[/eluser]
[quote author="NogDog" date="1240904671"] (Actually, since Noggin is neutered, that may be a bit difficult regardless of whether or not your dog is female. :bug: )[/quote] aaawww... rofl.
[eluser]Zeeshan Rasool[/eluser]
Nice question, look blog loads the page/view which you're given,so we have to load some data or have to show some record according to our function.So, comments() will load comments of blogs in view and same is with name().
[eluser]xwero[/eluser]
codeman if you are talking about the physical loading of files the whole blog.php file is loaded. MVC doesn't do magical tricks.
[eluser]Dam1an[/eluser]
I think the original question was refering more to the fact that CI doesn't load the entire stack (all the libraries, helpers etc) for you, but only the parts that you need (and specify)
[eluser]Thorpe Obazee[/eluser]
[quote author="Dam1an" date="1240923141"]I think the original question was refering more to the fact that CI doesn't load the entire stack (all the libraries, helpers etc) for you, but only the parts that you need (and specify)[/quote] Yep. that was what I think he was trying to say. |
Welcome Guest, Not a member yet? Register Sign In |