Jump to content

connection between classes


Julius

Recommended Posts

Hi,

 

I'm trying to write my first MVC framework for my college project and faced this problem: i have main framework class, and have this loader class, that loads view files and libraries. Now, how can I do that when I load library, I could reach it from my main class? For example: in main class goes this code:

public $load;

function __construct ( )
{ $this->load = new Loader; }

function someFunction ( )
{
    $this->load->library('someLibrary');
    // and now reach the library like this
    $this->someLibrary->functionInLibrary();
}

The idea is from codeigniter, so if anyone has used this framework will understand my question.

Link to comment
https://forums.phpfreaks.com/topic/250617-connection-between-classes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.