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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Can I add a folder along with cms, saffire etc.. that does not get processed by the framework


Go to End


3 Posts   1593 Views

Avatar
DusX

Community Member, 12 Posts

14 June 2010 at 2:08pm

I would like to be able to add folders of non module, non silverstripe code that I will use in a variety of ways (called my Javascript is one). There are many good php classes out there that could be used my the system if they didn't have to conform to the frameworks rules.

Is there a config setting that can be added to a config file in a folder that tells sapphire to ignore the folder contents?
Or does not including a config (I know its a requirement for modules) cause this?

Avatar
Willr

Forum Moderator, 5523 Posts

14 June 2010 at 5:40pm

Yes you can include a folder of your own totally separate classes without SS including it on your behalf.

If you include a _config.php (can just be an empty file) file in your folder then SilverStripe will read and automatically include all the files / classes you have in that folder for you. If you do not want SilverStripe to automatically load all your files then don't include a _config.php file. But then you will have to include your files the standard PHP way using require() and include().

If you have a folder that is inside a module which is being parsed then you can have a '_manifest_exclude' file (no extension and no content) inside any folder which will prevent SilverStripe from reading it or any of its children.

Avatar
DsX

Community Member, 178 Posts

15 June 2010 at 4:06am

great, I thought it should be as simple.
That really opens up what can be done as far a quick modules etc...
Guess my next step is to look for a tutorial on making a module.

thanks for all your help Willr... I am slowly starting to feel like I am getting a better grasp of SS and finally starting to understand the API docs.
I do however think that this is one spot another small tutorial might be very worthwhile... something that walk you through checking the API docs of an object to find related subclasses and methods that you can use... Would be very useful to us newbies.

anyway I got off topic.
Cheers