<?php

namespace WpBookingHotelAdmin\app\views\smscontent;

use WpBookingHotel\Html\ToolBar;
use WpBookingHotel\Mvc\Model\Model;
use WpBookingHotel\Mvc\View\View;
use WpBookingHotel\Factory as FactoryAlias;

class SmscontentView extends View
{
    public function display($tpl)
    {
        $modelsmscontent = Model::getInstance("smscontent");
        $input = FactoryAlias::getInput();
        switch ($tpl) {
            case "list":
                ToolBar::add("smscontent.add");
                ToolBar::delete("smscontent.delete_list");
                ToolBar::_clone("smscontent.clone_list");
                $model = Model::getInstance("smscontents");
                $this->list = $model->getList();
                break;
            case "form":
                ToolBar::setTitle('Edit smscontent');
                ToolBar::apply("smscontent.apply");
                ToolBar::save("smscontent.save");
                ToolBar::cancel("smscontent.cancel");
                ToolBar::back_to_list("smscontent.back_to_list");
                $id = $input->getInt('id', 0);
                $this->item = $modelsmscontent->getItem($id);
                $this->form = $modelsmscontent->getForm();
                break;
        }
        return parent::display($tpl);
    }
}