No description, website, or topics provided.
PHP JavaScript Scheme CSS
Clone or download
robbieaverill Merge pull request #22 from creative-commoners/pulls/master/add-suppo…
…rted-module-badge

Add supported module badge to readme
Latest commit a7f2e76 Jun 17, 2018
Permalink
Failed to load latest commit information.
_config Update Travis configuration to new style, add phpcs configuration Aug 23, 2017
client Minor UI improvements - use Bootstrap for text field and indent buttons Aug 23, 2017
src Add getter/setter for help text Feb 18, 2018
templates/SilverStripe/Forms Add class from cms Feb 18, 2018
tests NEW Remove Mockery from phpunit test suite Feb 5, 2018
.editorconfig NEW Add webpack module, updates for SS4 beta Aug 23, 2017
.eslintrc NEW Add webpack module, updates for SS4 beta Aug 23, 2017
.gitignore Adding built JS files to repo Aug 11, 2015
.scrutinizer.yml FIX Tidy up some formatting, rename "code" to "src", update license y… Feb 1, 2017
.travis.yml NEW Vendorise module, use new exposed Requirements API and update CI … Oct 25, 2017
_config.php Update Travis configuration to new style, add phpcs configuration Aug 23, 2017
code-of-conduct.md Added community files Aug 11, 2015
codecov.yml Update Travis configuration to new style, add phpcs configuration Aug 23, 2017
composer.json Update branch alias for 2.x-dev May 25, 2018
contributing.md Added community files Aug 11, 2015
license.md FIX Tidy up some formatting, rename "code" to "src", update license y… Feb 1, 2017
package.json NEW Add webpack module, updates for SS4 beta Aug 23, 2017
phpunit.xml.dist FIX convert CI bootstrap references to new their new locations in vendor Oct 4, 2017
readme.md Add supported module badge to readme Jun 15, 2018
webpack.config.js NEW Add webpack module, updates for SS4 beta Aug 23, 2017
yarn.lock NEW Add webpack module, updates for SS4 beta Aug 23, 2017

readme.md

SilverStripe Segment Field

Build Status SilverStripe supported module Code Quality Codecov Version License

A reusable approach to segment-generating fields.

Usage

use SilverStripe\Forms\SegmentField;
use SilverStripe\Forms\SegmentFieldModifier\SlugSegmentFieldModifier;
use SilverStripe\Forms\SegmentFieldModifier\IDSegmentFieldModifier;

SegmentField::create('PageName')->setModifiers(array(
    SlugSegmentFieldModifier::create()->setDefault('page'),
    array('-', ''),
    IDSegmentFieldModifier::create(),
))->setPreview($this->PageDisplayName)
  1. Starting with a value of "My New Page!".
  2. The value is passed through SlugSegmentFieldModifier.
  3. Preview value becomes "My-New-Page", Input value becomes "My-New-Page".
  4. The value is passed through array('-', '').
  5. Preview value becomes "My-New-Page-", Input value becomes "My-New-Page".
  6. The value is passed through IDSegmentFieldModifier.
  7. Preview value becomes "My-New-Page-1" (with the DataObject ID), Input value becomes "My-New-Page".

You can pass any similarly structured array or implementation of SilverStripe\Forms\SegmentFieldModifier in the modifiers list.

Versioning

This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.

All methods, with public visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.

Thanks

I'd like to thank SilverStripe for letting me work on fun projects like this. Feel free to talk to me about using the framework and CMS or working at SilverStripe.