/** * Builds JS code which loads configuration and necessary assets. * * This method should be called after using and rendering widgets, usually before closing </body> tag. * * @return string */ public function getCode() : string { return $this->code->toHtml(); }
public function visit(Code $code) : Code { $code->addScriptFile(self::SCRIPT_NAME, ['lazy_load' => true]); return $code; }