2017 © Pedro Peláez
 

library october-translatable-trait

Allows to easily setup the locale in OctoberCMS plugin components

image

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

The README.md

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();
    }
}

The Versions

02/02 2017

dev-master

9999999-dev

Allows to easily setup the locale in OctoberCMS plugin components

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar lunfel