Explaining $ this-> load-> view ()

In the controller, you can use this method to load the view, but I want to know what happens behind the scenes here.

I am new to PHP and frameworks, but I learned the basics of OOP.

When called $this->view(), the method in the current class or the parent class is used.

But what does it mean $this->load->view()? What is intermediate load? is it a function or is it a property?

Where is he located? How can it contain view ()?

Thanks for the explanation.

+3
source share
3 answers

This code refers to a member variable with a name loadthat has a method with a name view.

CodeIgniter - CI--, . , singleton , CI.

load CI_Loader, , . , , - .

+6

load . , view().

+3

Source: https://habr.com/ru/post/1740550/


All Articles