public function onRun() { $this->addJs('/plugins/samuell/slider/assets/owl.carousel.min.js'); $this->addCss('/plugins/samuell/slider/assets/owl.carousel.css'); $count = $this->property('max', 3); $slider = $this->property('slider'); if ($count >= 1) { $this->slider = $slider; $this->slides = SliderDB::take($count)->where("slider_id", $slider)->get(); } else { throw new ApplicationException(sprintf('Sorry only %s items are allowed.', $this->property('max'))); } }
public function index_onDelete() { if ($checkedIds = post('checked')) { foreach ($checkedIds as $itemId) { if (!($table = SlideDB::find($itemId))) { continue; } $table->delete(); } Flash::success("Removed slider."); } return $this->listRefresh(); }