library october-translatable-trait
Allows to easily setup the locale in OctoberCMS plugin components
lunfel/october-translatable-trait
Allows to easily setup the locale in OctoberCMS plugin components
- Thursday, February 2, 2017
- by lunfel
- Repository
- 1 Watchers
- 1 Stars
- 13 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Add the trait to the component and call the setupLocale
method in onRun
, (*1)
<?php namespace Vendor\Plugin\Components;
use Cms\Classes\ComponentBase;
use Lunfel\OctoberCMS\Translation\TranslatableComponentTrait;
class MyComponent extends ComponentBase
{
use TranslatableComponentTrait;
public function componentDetails()
{
return [
'name' => '...',
'description' => '...'
];
}
public function defineProperties()
{
return [];
}
public function onRun()
{
$this->setupLocale();
}
}
dev-master
9999999-dev
Allows to easily setup the locale in OctoberCMS plugin components
Sources
Download
MIT
The Requires
by
lunfel