Yii smarty plug-in ESmartyViewRenderer error correction-PHP source code

Source: Internet
Author: User
Yii smarty plug-in ESmartyViewRenderer error correction

Class ESmartyViewRenderer extends CApplicationComponent implements IViewRenderer {omitted .................. public function renderFile ($ context, $ sourceFile, $ data, $ return) {// current controller properties will be accessible as {$ this. property} $ data ['eas'] = $ context; // Yii: app ()->... is available as {Yii-> ...} (deprecated, use {Yii: app ()-> ...} instead, Smarty3 supports this .) $ data ['yii'] = Yii: Pp (); // time and memory information $ data ['Time'] = sprintf ('% 0.5f', Yii: getLogger ()-> getExecutionTime ()); $ data ['Memory '] = round (Yii: getLogger ()-> getMemoryUsage ()/(1024*1024), 2 ). 'mb'; // check if view file exists if (! Is_file ($ sourceFile) | ($ file = realpath ($ sourceFile) === false) throw new CException (Yii: t ('iiext ', 'view file "{file}" does not exist. ', array (' {file} '=> $ sourceFile); $ template = $ this-> smarty-> createTemplate ($ sourceFile, null, null, $ data, false); // render or return if ($ return) {/** source code error! * Return $ template-> fetch ($ sourceFile); * the correct call method is as follows. when a parameter is specified, all related parameters * return $ this-> smarty-> fetch ($ sourceFile, null, null, $ data, false) must be specified ); */return $ template-> fetch (); // All parameters are inherited from the $ template object} else {/** source code error! * $ Template-> display ($ sourceFile); * the correct call method is as follows. when a parameter is specified, all related parameters * $ this-> smarty-> display ($ sourceFile, null, null, $ data, false) must be specified; */$ template-> display (); // All parameters are inherited from the $ template object }}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.