Answer the question
In order to leave comments, you need to log in
Is it possible in Yii2 to check that the same widget has already been initialized in a view?
There is a specific widget that, when launched, registers the necessary asset and renders the necessary html code. An example code is:
public function run() {
Blueimp_BootstrapImageGalleryAsset::register($this->view);
return $this->renderItems()."\n".$this->renderControls();
}
public function run() {
$html = [];
if (!$this->view->HAVE_VIDGET($this)){
Blueimp_BootstrapImageGalleryAsset::register($this->view);
$html[] = $this->renderControls();
}
$html[] = $this->renderItems();
return implode("\n", $html);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question