2017 © Pedro PelĂĄez
 

symfony-bundle ip-field-bundle

Ip form type for symfony 2 forms

image

vx/ip-field-bundle

Ip form type for symfony 2 forms

  • Monday, February 10, 2014
  • by Vixys
  • Repository
  • 1 Watchers
  • 1 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

VxIpFieldTypeBundle

Provide an ip field for symfony forms., (*1)

Requirements

  • Symfony2.*

Installation

Composer

Add VxJsUploadBundle in your composer.json:, (*2)

``` json { "require": { "vx/ip-field-bundle": "dev-master" } }, (*3)


Now you can download the bundle with composer: ``` bash $ php composer.phar update vx/ip-field-bundle

AppKernel

Enable the bundle in the kernel:, (*4)

``` php <?php // app/AppKernel.php, (*5)

public function registerBundles() { $bundles = array( // ... new Vx\IpFieldTypeBundle\VxIpFieldTypeBundle(), ); }, (*6)


## Usage ### Create field Create your form : ``` php $form = $this->createFormBuilder() ->add('ip', 'ipfield') ->add('send', 'submit')->getForm();

You can specify the ip version (ipv4, ipv6 or mac) : ``` php ->add('ip', 'ipfield', array('version' => 'ipv4')), (*7)


``` php ->add('ip', 'ipfield', array('version' => 'ipv6'))

``` php ->add('ip', 'ipfield', array('version' => 'mac')), (*8)


### View ``` html {{ form_start(form) }} {{ form_errors(form) }} <div class="control-group"> <label class="control-label" for="ip">IP</label> <div class="controls"> {{ form_widget(form.ip, { 'id': 'my_ip_field', 'class': 'form-control' }) }} </div> </div> {{ form_rest(form) }} {{ form_end(form) }}

Licence

This bundle is under the MIT Licence., (*9)

The Versions

10/02 2014

dev-master

9999999-dev https://github.com/Vixys/VxIpFieldTypeBundle

Ip form type for symfony 2 forms

  Sources   Download

MIT

The Requires

 

by SĂ©bastien Marichal

form bundle symfony ip field type symfony bundle symfony-2