SilverStripe\SpellCheck\Handling\SpellController
Controller to handle requests for spellchecking
Synopsis
class SpellController
extends Controller
{
- // members
- private static array $locales = ;
- private static string|bool $default_locale = false;
- private static string $required_permission = 'CMS_ACCESS_CMSMain';
- private static bool $enable_security_token = true;
- private static bool $return_errors_as_ok = false;
- private static array $dependencies = ;
- protected SpellProvider $provider = NULL;
- protected array|null $data = NULL;
- // methods
- public SpellProvider getProvider()
- public static array get_locales()
- public $this setProvider()
- protected void result()
- protected void success()
- protected void error()
- public void index()
- protected array assembleData()
- protected void setHeaders()
- protected array getRequestData()
- protected string|false getLocale()
Hierarchy
Extends
- SilverStripe\Control\Controller
Members
private
- $default_locale
—
SilverStripe\SpellCheck\Handling\string|bool
Optional: define the default locale for TinyMCE instances. If not defined, the first locale in the list of available locales will be used. - $dependencies
—
array
Dependencies required by this controller - $enable_security_token
—
SilverStripe\SpellCheck\Handling\bool
Enable security token for spellchecking - $locales
—
array
Locales to spellcheck - $required_permission
—
string
Necessary permission required to spellcheck. Set to empty or null to disable restrictions. - $return_errors_as_ok
—
SilverStripe\SpellCheck\Handling\bool
If true, all error messages will be returned with a 200 OK HTTP header code
protected
- $data
—
SilverStripe\SpellCheck\Handling\array|null
Parsed request data - $provider
—
SilverStripe\SpellCheck\Data\SpellProvider
Spellcheck provider
Methods
protected
- assembleData() — Assemble an output data structure that is expected for TinyMCE 4
- error() — Set the error.
- getLocale() — Get the locale from the provided "lang" argument, which could be either a language code or locale
- getRequestData() — Get request data
- result() — Parse the output response
- setHeaders() — Ensures the response has the correct headers
- success()
public
- getProvider() — Get the current provider
- get_locales() — Gets locales to spellcheck for
- index()
- setProvider() — Set the provider to use