Skip to content

Instantly share code, notes, and snippets.

@kayue
Created January 9, 2015 17:31
Show Gist options
  • Save kayue/40c189a8713e31febba9 to your computer and use it in GitHub Desktop.
Save kayue/40c189a8713e31febba9 to your computer and use it in GitHub Desktop.
{% extends 'SyliusWebBundle::forms.html.twig' %}
{% block form_row %}
{% spaceless %}
<div class="form-group{% if errors|length > 0 %} has-error{% endif %}">
{% if form.vars.name == 'value' %}
<div class="col-lg-1">
<a href="javascript:void(null)" class="movable">
<i class="glyphicon glyphicon-sort"></i>
</a>
</div>
{% endif %}
{{ form_label(form) }}
<div class="col-lg-9">
{{ form_widget(form) }}
{% for error in errors %}
<span class="help-block form-error">
{{ error.messagePluralization is null
? error.messageTemplate|trans(error.messageParameters, 'validators')
: error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') }}
</span>
{% endfor %}
</div>
</div>
{% endspaceless %}
{% endblock form_row %}
<?php
namespace Hypebeast\Bundle\CoreBundle\Entity;
use Sylius\Component\Product\Model\OptionValue as BaseOptionValue;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_option_value")
*/
class OptionValue extends BaseOptionValue
{
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $position;
/**
* {@inheritdoc}
*/
public function __toString()
{
return $this->value;
}
public function getPosition()
{
return $this->position;
}
public function setPosition($position)
{
$this->position = $position;
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment