Hello, on the Yii framework, the Couponic script system is made. There is a countdown function using the jquery.countdown script. The problem is that when I call the function
<?=app()->controller->worklet('deal.timeLeft', array('start' => $data->start, 'end' => $data->end, 'timeZone' => $data->timeZone));?> This function calls the controller which renders the script.
public function taskRenderOutput() { $this->js(); $layoutView = $this->end-time() > 86400 ? $this->counterLayoutFull : $this->counterLayoutShort; $layout = $this->render($layoutView,null,true); cs()->registerScript(__CLASS__, 'var untilDate = new Date('.($this->end * 1000).'); $("#'.$this->getDOMId().' .timer").countdown({until: untilDate, layout: "' . $layout . '", onTick: function(periods){ $("#'.$this->getDOMId().'").uTimeLeftTick(periods,'.($this->end-$this->start).'); }});'); $this->render('timeLeft'); } But if I make several calls, it does not generate a script in the bottom of the site, but most likely sees that the double and removes. I do not know how to be, maybe this is a feature of Yii, or do I have to dig into the Couponic script