diff --git a/_config/config.yml b/_config/config.yml new file mode 100644 index 0000000..586e40b --- /dev/null +++ b/_config/config.yml @@ -0,0 +1,6 @@ +--- +Name: externalurlfield +--- +SilverStripe\Core\Injector\Injector: + ExternalURL: + class: BurnBright\ExternalURLField\ExternalURL diff --git a/composer.json b/composer.json index ad3c80c..1682378 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,33 @@ { - "name": "burnbright/silverstripe-externalurlfield", - "description": "Provides SilverStripe with a DBField and FormField for handling external URLs.", - "type": "silverstripe-module", - "license": "MIT", - "keywords": ["silverstripe", "url", "link", "form", "field"], - "require": { - "silverstripe/framework": "^4.0@dev", - "jakeasmith/http_build_url": "^1" - }, + "name": "burnbright/silverstripe-externalurlfield", + "description": "Provides SilverStripe with a DBField and FormField for handling external URLs.", + "type": "silverstripe-vendormodule", + "license": "MIT", + "keywords": [ + "silverstripe", + "url", + "link", + "form", + "field" + ], + "require": { + "silverstripe/framework": "^4.0", + "silverstripe/vendor-plugin": "^1.0", + "jakeasmith/http_build_url": "^1" + }, "require-dev": { "phpunit/phpunit": "^5.7" }, - "extra": { - "installer-name": "externalurlfield" - }, - "authors": [ - { - "name": "Jeremy Shipman", - "homepage": "https://github.com/jedateach", - "role": "Developer" - } - ], + "extra": { + "installer-name": "externalurlfield" + }, + "authors": [ + { + "name": "Jeremy Shipman", + "homepage": "https://github.com/jedateach", + "role": "Developer" + } + ], "autoload": { "psr-4": { "BurnBright\\ExternalURLField\\": "src/", diff --git a/src/ExternalURLField.php b/src/ExternalURLField.php index b08b4f6..c23cd4e 100644 --- a/src/ExternalURLField.php +++ b/src/ExternalURLField.php @@ -120,6 +120,8 @@ public function getAttributes() /** * Rebuild url on save * @param string $url + * @param array|DataObject $data {@see Form::loadDataFrom} + * @return $this */ public function setValue($url, $data = NULL) {