----------------------------------------------------
* 鍙栧緱鏁版嵁璁块棶绫荤殑瀹炰緥
+----------------------------------------------------------
* @access protected
+----------------------------------------------------------
* @return mixed
+----------------------------------------------------------
* @throws ThinkExecption
+----------------------------------------------------------
*/
protected function getModelClass()
{
$model = D($this->name);
return $model;
}
/**
+----------------------------------------------------------
* 鍙栧緱鎿嶄綔鎴愬姛鍚庤杩斿洖鐨刄RL鍦板潃
* 榛樿杩斿洖褰撳墠妯″潡鐨勯粯璁ゆ搷浣?
+----------------------------------------------------------
* @access public
+----------------------------------------------------------
* @return string
+----------------------------------------------------------
* @throws ThinkExecption
+----------------------------------------------------------
*/
protected function getReturnUrl()
{
return url(C('DEFAULT_ACTION'));
}
/**
+----------------------------------------------------------
* 妯℃澘鏄剧ず
* 璋冪敤鍐呯疆鐨勬ā鏉垮紩鎿庢樉绀烘柟娉曪紝
+----------------------------------------------------------
* @access public
+----------------------------------------------------------
* @param string $templateFile 鎸囧畾瑕佽皟鐢ㄧ殑妯℃澘鏂囦欢
* 榛樿涓虹┖ 鐢辩郴缁熻嚜鍔ㄥ畾浣嶆ā鏉挎枃浠?
* @param string $charset 杈撳嚭缂栫爜
* @param string $contentType 杈撳嚭绫诲瀷
* @param string $varPrefix 妯℃澘鍙橀噺鍓嶇紑
+----------------------------------------------------------
* @return void
+----------------------------------------------------------
*/
public function display($templateFile='',$charset='',$contentType='text/html',$varPrefix='')
{
if(C('ACTION_CACHE_ON') && in_array(ACTION_NAME,$this->_cacheAction,true)) {
// 鍚敤Action缂撳瓨
$content = $this->fetch($templateFile,$charset,$contentType,$varPrefix);
S(md5(__SELF__),$content);
echo $content;
}else{
$this->tpl->display($templateFile,$charset,$contentType,$varPrefix);
}
}
/**
+----------------------------------------------------------
* 鑾峰彇杈撳嚭椤甸潰鍐呭
* 璋冪敤鍐呯疆鐨勬ā鏉垮紩鎿巉etch鏂规硶锛?
+----------------------------------------------------------
* @access public
+----------------------------------------------------------
* @param string $templateFile 鎸囧畾瑕佽皟鐢ㄧ殑妯℃澘鏂囦欢
* 榛樿涓虹┖ 鐢辩郴缁熻嚜鍔ㄥ畾浣嶆ā鏉挎枃浠?
* @param string $charset 杈撳嚭缂栫爜
* @param string $contentType 杈撳嚭绫诲瀷
* @param string $varPrefix 妯℃澘鍙橀噺鍓嶇紑
+----------------------------------------------------------
* @return void
+----------------------------------------------------------
*/
public function fetch($templateFile='',$charset='',$contentType='text/html',$varPrefix='')
{
return $this->tpl->fetch($templateFile,$charset,$contentType,$varPrefix,false);
}
/**
+----------------------------------------------------------
* 杈撳嚭甯冨眬椤甸潰鍐呭
* 璋冪敤鍐呯疆鐨勬ā鏉垮紩鎿巉etch鏂规硶锛?
+----------------------------------------------------------
* @access public
+----------------------------------------------------------
* @param string $templateFile 鎸囧畾瑕佽皟鐢ㄧ殑甯冨眬妯℃澘鏂囦欢
* @param string $charset 杈撳嚭缂栫爜
* @param string $contentType 杈撳嚭绫诲瀷
* @param string $varPrefix 妯℃澘鍙橀噺鍓嶇紑
* @param boolean $display 鏄惁杈撳嚭
+----------------------------------------------------------
* @return void
+----------------------------------------------------------
*/
public function layout($templateFile,$charset='',$contentType='text/html',$varPrefix='',$display=true)
{
return $this->tpl->layout($template