php - what is $this->load->view() in CodeIgniter -
$this
use current class , view
method load
. property?
is example correct?
class super{ public $property; public function superf1() { echo "hello"; } public function col() { $this->superf1(); } $this->property->super1(); }
yes, load
property. think of this:
class loader { public function view() { //code... } } class myclass { private $load; public __constructor() { $this->load = new loader(); } public somemethod() { $this->load->view(); } }
this syntax called chaining.
Comments
Post a Comment