Post by wangllam » Thu Dec 08, 2011 11:00 am

I saw controller class use global methods
eg. $this->document->getTitle();
but there is no document object defined in the controller class, i want to know how the getTitle() call as I could not found a class member "document" inside the controller class
also where can i find the controller class get instantiated?
Last edited by wangllam on Thu Dec 08, 2011 2:10 pm, edited 1 time in total.

Newbie

Posts

Joined
Mon Dec 05, 2011 9:16 pm

Post by straightlight » Thu Dec 08, 2011 1:57 pm

Incorrect. There's a document object from index.php file and admin/index.php file which then gets registered in order to be globalized within the entire catalog and another one within the entire admin.

Code: Select all

// Document
$document = new Document();
$registry->set('document', $document);

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rph » Thu Dec 08, 2011 1:58 pm

/index.php
/system/library/document.php

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by wangllam » Thu Dec 08, 2011 2:08 pm

straightlight wrote:Incorrect. There's a document object from index.php file and admin/index.php file which then gets registered in order to be globalized within the entire catalog and another one within the entire admin.

Code: Select all

// Document
$document = new Document();
$registry->set('document', $document);
thank you very much ;D
then I try to understand what index.php doing inside

Newbie

Posts

Joined
Mon Dec 05, 2011 9:16 pm

Post by straightlight » Thu Dec 08, 2011 2:17 pm

The index.php is mainly as inclusively considered global.php file mixed with an index definition while we compare with non-CMS platform applications. ;)

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 31 guests