From 5b780fd38ac18c600a34901584644690779ca2bf Mon Sep 17 00:00:00 2001 From: Gevorg Mansuryan Date: Sat, 14 Oct 2017 02:43:04 +0400 Subject: [PATCH] v1.2 --- src/LazyBlock.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LazyBlock.php b/src/LazyBlock.php index 42a8b81..344b9ca 100644 --- a/src/LazyBlock.php +++ b/src/LazyBlock.php @@ -21,7 +21,9 @@ class LazyBlock extends Widget public $effect = self::EFFECT_SLIDE_UP; public $delay = 0; public $speed = 600; - public $options; + public $options = [ + 'class' => [] + ]; public function init() { @@ -33,7 +35,7 @@ public function init() public function run() { $this->options['id'] = $this->id; - $this->options['class'] = (array)$this->options['class']; + $this->options['class'] = ArrayHelper::toArray(ArrayHelper::getValue($this->options, 'class', [])); if ($this->effect) { $this->options = ArrayHelper::merge( $this->options, [