kohana框架类扩展透明性

来源:互联网 发布:千里眼定位软件 编辑:程序博客网 时间:2024/06/05 20:50
直接在需要的地方进行继承扩展即可,类中加入自己想要的方法
class Cookie extends Kohana_Cookie {}
有些都是抽象类,这时就要注意对抽象方法的实现

<?php defined('SYSPATH') or die('No direct script access.');
/**
* session类扩展,增加flashdata方法
*
* @package modules/admin
* @category Controllers
* @author lmeng
*/
class Session extends Kohana_Session {
public function flashdata($message)
{

echo '你输入的信息是:'.$message;
exit;
}

/**
* Loads the raw session data string and returns it.
*
* @param string session id
* @return string
*/
protected function _read($id = NULL)
{

}

/**
* Generate a new session id and return it.
*
* @return string
*/
protected function _regenerate()
{

}

/**
* Writes the current session.
*
* @return boolean
*/
protected function _write()
{

}

/**
* Destroys the current session.
*
* @return boolean
*/
protected function _destroy()
{

}

/**
* Restarts the current session.
*
* @return boolean
*/
protected function _restart()
{

}




}
?>


原创粉丝点击