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 }}}