PHP code example of jlorente / yii2-widget-remainingcharacters

1. Go to this page and download the library: Download jlorente/yii2-widget-remainingcharacters library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jlorente / yii2-widget-remainingcharacters example snippets


use jlorente\remainingcharacters\RemainingCharacters;

// 
echo $form->field($model, 'my-textarea')->widget(RemainingCharacters::classname(), [
    'type' => RemainingCharacters::INPUT_TEXTAREA,
    'text' => Yii::t('app', '{n} characters remaining'),
    'label' => [
        'tag' => 'p',
        'id' => 'my-counter',
        'class' => 'counter',
        'invalidClass' => 'error'
    ],
    'options' => [
        'rows' => '3',
        'class' => 'col-md-12',
        'maxlength' => 200,
        'placeholder' => Yii::t('app', 'Write something')
    ]
]);
bash
$ php composer.phar