Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

how to autoload class


Go to End


2 Posts   3768 Views

Avatar
snaip

Community Member, 181 Posts

4 April 2009 at 5:10am

Edited: 04/04/2009 5:16am

hi

i want to extends class on 3 another

i want to get this:

*********************HomePage_Controller
**************************extends

*************//*************||*****************\\
************//**************||******************\\
*******WycieczkaHolder****ApartamenyHolder**InneHolder
************||**************||*********************||
************||**************||*********************||
*********WycieczkaPage****ApartamentyPage***InnePage

i tried __autoload() but something wrog

class PlHomePage_Controller extends PlPage_Controller {


     function __autoload('WycieczkaHolder_Controller') {
          require_once("WycieczkaHolder.php");
     }


}

Avatar
Willr

Forum Moderator, 5523 Posts

4 April 2009 at 6:27pm

If all your code files are in /mysite/ or in a folder/ with a _config file (and no _manifest_exclude) in them SilverStripe will automatically include them for you, without you having to do any auto loading