2017 © Pedro Peláez
 

yii2-extension yii2-field-widgets

The form field widgets for Yii2 Framework with multilanguage mode support.

image

itstructure/yii2-field-widgets

The form field widgets for Yii2 Framework with multilanguage mode support.

  • Monday, May 14, 2018
  • by itstructure
  • Repository
  • 0 Watchers
  • 0 Stars
  • 43 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 30 % Grown

The README.md

Yii2 Field widgets

Introduction

Latest Stable Version Latest Unstable Version License Total Downloads Build Status Scrutinizer Code Quality, (*1)

This is form field's widgets for the yii2 framework with the next field types:, (*2)

  • text
  • textarea
  • ckeditor
  • ckeditorAdmin
  • file
  • checkbox
  • dropdown
  • password

Dependencies

  • php >= 7.1
  • composer

Installation

Base install

Via composer:, (*3)

composer require "itstructure/yii2-field-widgets": "~1.2.4", (*4)

or in section require of composer.json file set the following:, (*5)

"require": {
    "itstructure/yii2-field-widgets": "~1.2.4"
}

and command composer install, if you install yii2 project extensions first,, (*6)

or command composer update, if all yii2 project extensions are already installed., (*7)

If you are testing this package from local server directory

In application composer.json file set the repository, like in example:, (*8)

"repositories": [
    {
        "type": "path",
        "url": "../yii2-field-widgets",
        "options": {
            "symlink": true
        }
    }
],

Here,, (*9)

yii2-field-widgets - directory name, which has the same directory level like application and contains yii2 field widgets package., (*10)

Then run command:, (*11)

composer require itstructure/yii2-field-widgets:dev-master --prefer-source, (*12)

Usage

Requirements

That widgets are designed to work in form with an active model, which is inherited from yii\db\ActiveRecord., (*13)

Single mode

To use this mode, don't set languageModel. That will be null., (*14)

Multilanguage mode

All fields will be with a language postfix:, (*15)

title_en, (*16)

description_en, (*17)

title_ru, (*18)

description_ru, e t. c., (*19)

For this mode it's necessary to have Language model with some of languages records., (*20)

Example:, (*21)

$form = ActiveForm::begin();
echo Fields::widget([
    'fields' => [
        [
            'name' => 'title',
            'type' => FieldType::FIELD_TYPE_TEXT,
        ],
        [
            'name' => 'description',
            'type' => FieldType::FIELD_TYPE_CKEDITOR_ADMIN,
            'preset' => 'full',
            'options' => [
                'filebrowserBrowseUrl' => '/ckfinder/ckfinder.html',
                'filebrowserImageBrowseUrl' => '/ckfinder/ckfinder.html?type=Images',
                'filebrowserUploadUrl' => '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                'filebrowserImageUploadUrl' => '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                'filebrowserWindowWidth' => '1000',
                'filebrowserWindowHeight' => '700',
            ]
        ],
    ],
    'model'         => $model,
    'form'          => $form,
    'languageModel' => new Language()
]) ?>
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
ActiveForm::end();

License

Copyright © 2018-2023 Andrey Girnik girnikandrey@gmail.com., (*22)

Licensed under the MIT license. See LICENSE.txt for details., (*23)

The Versions

14/05 2018

dev-master

9999999-dev

The form field widgets for Yii2 Framework with multilanguage mode support.

  Sources   Download

MIT

The Requires

 

yii2 yii 2 widget field multilanguage

14/05 2018

1.2.0

1.2.0.0

The form field widgets for Yii2 Framework with multilanguage mode support.

  Sources   Download

MIT

The Requires

 

yii2 yii 2 widget field multilanguage

13/02 2018

1.1.0

1.1.0.0

The form field widgets for Yii2 Framework with multilanguage mode support.

  Sources   Download

MIT

The Requires

 

yii2 yii 2 widget field multilanguage

13/02 2018

dev-dev

dev-dev

The form field widgets for Yii2 Framework with multilanguage mode support.

  Sources   Download

MIT

The Requires

 

yii2 yii 2 widget field multilanguage

04/02 2018

1.0.0

1.0.0.0

The form field widgets for Yii2 Framework with multilanguage mode support.

  Sources   Download

MIT

The Requires

 

yii2 yii 2 widget field multilanguage