You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
888 B

<?php
/**
* AjaxAction
*
* @copyright NetMonsters <team@netmonsters.ru>
* @link
* @package Kuperauto
* @subpackage face
* @since
* @version SVN: $Id$
* @filesource $URL$
*/
/**
* базовый класс для всей экшенов выполняющихся по аякс-запросу
*/
abstract class AjaxAction extends Action
{
public $data = 1;
protected $encode = true;
function __construct()
{
parent::__construct();
$this->template = 'ajax';
}
function fetch()
{
// header("Content-type: application/json; charset=utf-8");
header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-store, no-cache, must-revalidate");
$this->view->assign('data', $this->encode ? json_encode($this->data) : $this->data);
return $this->view->fetch($this->getTemplate());
}
}