/** * * @param \Hitar\Table $table * @param string $name */ function __construct($table, $name = 'page') { $this->table = $table; $this->_name = $name; $this->_page = intval(\Hiano\App\App::getRequest()->getParameter($name)); if ($this->_page < 1) { $this->_page = 1; } $this->buttons = array('first' => array('href' => '', 'caption' => '首页'), 'prev' => array('href' => '', 'caption' => '上页'), 'next' => array('href' => '', 'caption' => '下页'), 'last' => array('href' => '', 'caption' => '末页')); }
/** * * @param type $params * @param type $content * @param \Smarty_Internal_Template $template * @param type $repeat * @return string */ static function block_form($params, $content, $template, &$repeat) { if (!$repeat) { $ret = '<form'; if ($params) { foreach ($params as $key => $value) { $ret .= ' ' . $key . '="' . $value . '"'; } } $ret .= ">\n" . $content . '<input type="hidden" name="_csrftoken" value="' . \Hiano\App\App::getRequest()->getCookie('_csrftoken') . '" /></form>'; return $ret; } }