/**
  * @param Compound $root
  * @param bool $prepend
  */
 public function attachToCompound(Compound $root, $prepend = false)
 {
     parent::attachToCompound($root, $prepend);
     // try to update pagination immediately
     // because it can be rendered before this component.
     $this->paginationControl || Utils::applyCallback(function (PaginationControl $pagination) {
         $this->paginationControl || $this->setPaginationControl($pagination);
     }, $root, PaginationControl::class);
 }
Example #2
0
 public function attachToCompound(Compound $root, $prepend = false)
 {
     // prepend component that will render results
     $root->children()->add(new DataView(function () {
         if ($this->inputOption->hasValue()) {
             $this->renderCsv();
         }
     }), true);
     parent::attachToCompound($root, $prepend);
 }