<?php
namespace WpBookingEventFrontend\app\views\block;
use WpBookingEvent\Factory;
use WpBookingEvent\Mvc\Model\Model;
use WpBookingEvent\Mvc\View\View;
class BlockView extends View
{
    public function display($tpl){

        $input = Factory::getInput();
        $modelBlock = Model::getInstance('block');


        switch ($tpl) {
            case "preview":
                
                $id = $input->getInt('id', 0);
                $this->item = $modelBlock->getItem($id);
                break;
            case "config":
                $id = $input->getInt('id', 0);
                $this->item = $modelBlock->getItem($id);
                $this->form = $modelBlock->getFormBlockConfig($this->item->id);

            case "list":
                $modelBlocks = Model::getInstance('blocks');
                $this->items = $modelBlocks->getList();


                break;
        }
        return parent::display($tpl);
    }

}