/** * This method will be called when the component becomes attached to Form. * * @param IComponent $form */ protected function attached($form) { parent::attached($form); if ($form instanceof IPresenter) { $this->createPlaceholder(); } }
protected function attached($component) { parent::attached($component); $this->componentControlAttached($component); if ($component instanceof Nette\Application\IPresenter) { $this->control->{'data-typeahead-url'} = $this->link('autocomplete!', ['q' => '__QUERY_PLACEHOLDER__']); } }
/** * Adds static files when connected to form (and presenter). * * @param IComponent * @return void */ protected function attached($parent) { parent::attached($parent); if ($parent instanceof Nette\Application\UI\Presenter) { $context = $parent->getContext(); $context->webFilesGenerator->addFile(__DIR__ . '/Js/bootstrap-select.js', WebFilesGenerator::JAVASCRIPT); $context->webFilesGenerator->addFile(__DIR__ . '/Css/bootstrap-select.css', WebFilesGenerator::STYLESHEET); } }