2017 © Pedro Peláez
 

cakephp-plugin cakephp-fieldtypes

FieldTypes plugin for CakePHP.

image

jeffersonsimaogoncalves/cakephp-fieldtypes

FieldTypes plugin for CakePHP.

  • Thursday, June 28, 2018
  • by jeffersonsimaogoncalves
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

FieldTypes plugin for CakePHP

Note: This is a non-stable plugin for CakePHP 3.x at this time. It is currently under development and should be considered experimental., (*1)

Installation

You can install this plugin into your CakePHP application using composer., (*2)

The recommended way to install composer packages is:, (*3)

composer require jeffersonsimaogoncalves/cakephp-fieldtypes

Now load the plugin with the command:, (*4)

bin/cake plugin load -r -b FieldTypes

Usage

You can use the FieldTypes extending core FormHelper with BootstrapUI.Form then setting the widgets you want to use., (*5)

$this->loadHelper('Form', [
    'className' => 'BootstrapUI.Form',
    'widgets' => [
        //Date
        'flatpickr' => ['FieldTypes\View\Widget\FlatpickrWidget', '_view'],
        'bootstrap-datepicker' => ['FieldTypes\View\Widget\BootstrapDatepickerWidget', '_view'],
        'bootstrap-datetimepicker' => ['FieldTypes\View\Widget\BootstrapDatetimepickerWidget', '_view'],

        //Color
        'bootstrap-colorpicker' => ['FieldTypes\View\Widget\BootstrapColorpickerWidget', '_view'],

        //Number
        'bootstrap-touchspin' => ['FieldTypes\View\Widget\BootstrapTouchspinWidget', '_view'],

        //Boolean
        'bootstrap-switch' => ['FieldTypes\View\Widget\BootstrapSwitchWidget', '_view'],

        //Content
        'summernote' => ['FieldTypes\View\Widget\SummernoteWidget', '_view'],
        'wysiwygjs' => ['FieldTypes\View\Widget\WysiwygjsWidget', '_view'],

        //Select
        'bootstrap-select' => ['FieldTypes\View\Widget\BootstrapSelectWidget', '_view'],
        'select2' => ['FieldTypes\View\Widget\Select2Widget', '_view'],

        //Other
        'stringtoslug' => ['FieldTypes\View\Widget\StringToSlugWidget', '_view'],
        'textcount' => ['FieldTypes\View\Widget\TextCounterWidget', '_view'],
    ]
]);

You can override default widgets too., (*6)

$this->loadHelper('Form', [
    'className' => 'BootstrapUI.Form',
    'widgets' => [
        'date' => ['FieldTypes\View\Widget\FlatpickrWidget', '_view'],
        'select' => ['FieldTypes\View\Widget\Select2Widget', '_view']
    ]
]);

And then, using it:, (*7)

$this->Form->input('some_field', ['type' => 'summernote']);

It also works nice with CakeAdmin formFields., (*8)

public function postType() {
    return [
        'formFields' => [
            'some_field' => [
                'type' => 'summernote',
            ],
        ]
    ];
};

Types

Select2 - GitHub

'type' => 'select2'

select2, (*9)

'type' => 'select2', 'multiple' => true

select2, (*10)

Summernote - GitHub

'type' => 'summernote'

summernote, (*11)

Bootstrap Datepicker - GitHub

'type' => 'datepicker'

datepicker, (*12)

Bootstrap Colorpicker - GitHub

'type' => 'colorpicker'

colorpicker, (*13)

Bootstrap TouchSpin - GitHub

'type' => 'touchspin'

touchspin, (*14)

Bootstrap Toggle - GitHub

'type' => 'toggle'

toggle, (*15)

Credits

This work is based on the code by Leonardo Ruhland., (*16)

The Versions

28/06 2018

dev-master

9999999-dev

FieldTypes plugin for CakePHP.

  Sources   Download

MIT

The Requires

 

28/06 2018

1.0.1

1.0.1.0

FieldTypes plugin for CakePHP.

  Sources   Download

MIT

The Requires

 

28/06 2018

1.0.0

1.0.0.0

FieldTypes plugin for CakePHP.

  Sources   Download

MIT

The Requires