<?php
namespace Extension;
 use TCMS\ControlExtension;
 use TCMS\TException;
 class InputPriceDefault extends ControlExtension {
 public $option = [ 'name' => 'price', 'format' => '0,0', 'error' => false ];
 public function render($value, $option = null) {
 if(empty($option['name'])) throw new TException('Vui lòng truyền option cho extension datetime picker', 501);
 copy_option($this->option, $option);
 $this->addStyle(asset('/style/bootstrap.min.css'));
 echo '<input type="text" data-format="'.$this->option['format'].'" name="'.$this->option['name'].'" value="'.$value.'" class="input-price-ext form-control'. ($this->option['error'] ? ' error' : '') .'" id="'.$this->option['name'].'" />';
 $this->addScript(asset('/script/input-price-default/numeral.min.js'));
 $this->addScript(asset('/script/input-price-default/input-price-default.js'));
 }
 }
 ?>