public function addDomReadyScript($js, $order = self::DEFAULT_ORDER) { if (!empty($js)) { if (!$this->isPopulated()) { parent::addDomReadyScript($js, $order); } else { $this->document->addScriptDeclaration($js); } } }