silverstripe-module ss-mwm-core
Some basic utilities used across multiple Milkyway Multimedia modules
milkyway-multimedia/ss-mwm-core
Some basic utilities used across multiple Milkyway Multimedia modules
- Friday, April 1, 2016
- by mi3ll
- Repository
- 2 Watchers
- 1 Stars
- 333 Installations
- PHP
- 3 Dependents
- 0 Suggesters
- 1 Forks
- 2 Open issues
- 1 Versions
- 4 % Grown
Features
- New utility methods to use across your projects
- Allow uploads in UploadField
- Tabs can be loaded from URL hashes
- You can also link to tabs if your link has the class:
ss-tabset-goto
- New context menu options for your SiteTree
- Publish Record
- Unpublish Record
- Delete permanently
- Allow cookie_path and cookie_domain to be set for Cookies
Additional methods included on extensions
- Controller
- ->BackLink
- ->displayNiceView(): Display this controller in a pretty website style page
- ->respondToFormAppropriately(): Either return a json encoded response or a redirect when not in an ajax request
- DataObject
- ->i18n_description()
- ->firstOrMake($filter = [], $additionalData = [], $write = true): Get matching record, or make if it doesnt exist
- ->is_a($class): for templates
- ->is_not_a($class): for templates
- ->InheritedObj($fieldName): Get an inherited object (dot notation allowed). It will check the following:
- Cache
- Method on current object
- If object has parent method (or extends @Hierarchy), it will check the parents
- Check home page if it exists
- Check SiteConfig if it exists
- DBField: This has quite a few new methods, check the phpdoc for more info
- Member:
singleton('director')
This extends Director and has a few utility methods related to dealing with the SiteTree and Controllers, and adds some new template globals, (*1)
- secureBaseURL
- nonSecureBaseURL
- baseWebsiteURL - The url without the protocol or www, the pretty url
- protocol
- homePage
- isHomePage($page = SiteTree|int)
- adminLink
- siteConfig
singleton('mwm')
Some utility methods to deal with some stuff I could not do with vanilla Silverstripe, and also adds some new template globals, (*2)
- canAccessCMS
- canEditCurrentPage
- appDir
- is($type = string)
Install
Add the following to your composer.json file, (*3)
"require" : {
"milkyway-multimedia/ss-mwm-core": "dev-master"
}
License
Version
Mellisa Hankins
- E-mail: mellisa.hankins@me.com
- Twitter: @mi3ll
- Website: mellimade.com.au
dev-master
9999999-dev
Some basic utilities used across multiple Milkyway Multimedia modules
Sources
Download
MIT
The Requires
The Development Requires
by
Mellisa Hankins
silverstripe
utilities
mwm