コード例 #1
0
 public function __construct($id = null)
 {
     if (is_numeric($id)) {
         $this->id = $id;
     }
     parent::__construct();
 }
コード例 #2
0
 public function __construct($size, $role)
 {
     parent::__construct($size);
     for ($i = 0; $i < $size; $i++) {
         $this->add(['name' => $i . 'c', 'type' => 'Text', 'attributes' => ['class' => 'form-control']]);
         $this->add(['name' => $i . 'i', 'type' => 'Text', 'attributes' => ['class' => 'form-control']]);
     }
     if ($role < \Account\Model\Role::CO) {
         $this->get('strategy')->setAttribute('readonly', 'readonly');
     }
     if ($role < \Account\Model\Role::ELDER) {
         for ($i = 0; $i < $size; $i++) {
             $this->get($i)->setAttribute('readonly', 'readonly');
         }
     }
     $this->get('submit')->setAttribute('value', 'Update');
 }