2017 © Pedro Peláez
 

yii2-extension yii2-barcode-validator

Barcode validator

image

lembadm/yii2-barcode-validator

Barcode validator

  • Monday, April 11, 2016
  • by lembadm
  • Repository
  • 1 Watchers
  • 3 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 9 % Grown

The README.md

Yii2 Barcode validator

Validate Code39, EAN8, EAN12, EAN13, ITF14 barcodes, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist lembadm/yii2-barcode-validator "*"

or add, (*4)

"lembadm/yii2-barcode-validator": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your model validation rules :, (*6)

<?php

class Product extends ActiveRecord
{

    public function rules()
    {
        return [
            // Barcode [[barcode]]
            ['barcode', 'required'],
            ['barcode', 'string', 'max' => 255],
            ['barcode', BarcodeValidator::className(), 'typeAttribute' => 'code_type'],

            // Barcode type [[code_type]]
            ['code_type', 'required'],
        ];
    }

}

The Versions

11/04 2016

dev-master

9999999-dev

Barcode validator

  Sources   Download

MIT

The Requires

 

by Alex Vizhanov

extension yii2