Welcome Guest, Not a member yet? Register   Sign In
$this->load->view() ???
#5

[eluser]Jim OHalloran[/eluser]
[quote author="CI_" date="1187938972"]where did he get those??? were they from CI defined functions?[/quote]

When you extend a class, all of the functions and variables in the class that you've extended become available to the new class (see the PHP manual for more information).

[quote author="CI_" date="1187938972"]
Code:
class Blog extends Controller {
[/quote]

This is the key line of code. The Blog class extends the basic Controller class and therefore everything from the Controller class is available via the $this variable (along with Blog specific stuff). The "load->view()" part is supplied by CodeIgniter itself, take a look at the CI manual as others have pointed out for more information.

Inheritance can be difficult to wrap your head around because all of this stuff suddenly becomes available via $this which you can't see in your code (it's in the base class), but it's extremely owerful once you're used to the idea.

Jim.


Messages In This Thread
$this->load->view() ??? - by El Forum - 08-23-2007, 08:02 PM
$this->load->view() ??? - by El Forum - 08-24-2007, 02:49 AM
$this->load->view() ??? - by El Forum - 08-24-2007, 02:50 AM
$this->load->view() ??? - by El Forum - 08-24-2007, 02:59 AM
$this->load->view() ??? - by El Forum - 08-30-2007, 06:31 PM
$this->load->view() ??? - by El Forum - 08-31-2007, 03:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB