| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace Dcat\Admin\Form\Concerns;
- use Closure;
- use Dcat\Admin\Form\Row;
- trait HasRows
- {
- /**
- * Field rows in form.
- *
- * @var Row[]
- */
- protected $rows = [];
- /**
- * Add a row in form.
- *
- * @param Closure $callback
- *
- * @return $this
- */
- public function row(Closure $callback)
- {
- $this->rows[] = new Row($callback, $this);
- return $this;
- }
- /**
- * @return Row[]
- */
- public function rows()
- {
- return $this->rows;
- }
- }
|