Пример #1
0
 /**
  * Handle the view's table modification.
  *
  * @param TableBuilder  $builder
  * @param ViewInterface $view
  */
 public function handle(TableBuilder $builder, ViewInterface $view)
 {
     if (!($handler = $view->getHandler())) {
         return;
     }
     /*
      * If the handler is a callable string or Closure
      * then call it using the IoC container.
      */
     if (is_string($handler) || $handler instanceof \Closure) {
         $this->container->call($handler, compact('builder'));
     }
     /*
      * If the handle is an instance of ViewHandlerInterface
      * simply call the handle method on it.
      */
     if ($handler instanceof ViewHandlerInterface) {
         $handler->handle($builder);
     }
 }