<?php
class HomepagePresenter extends BasePresenter
{
    public function renderDefault()
    {
        $this->template->time = date(DATE_RFC822);
    }

    public function handleRefresh()
    {
         if( $this->isAjax() ) {
            $this['com']->invalidateControl();
        } else {
            $this->redirect('this');
        }
    }
    
    public function handleRefreshDelay()
    {
        if( $this->isAjax() ) {
            sleep(4);
            $this['com']->invalidateControl();
        } else {
            $this->redirect('this');
        }
    }

    protected function createComponentCom()
    {
        return new Com();
    }
}