truepath($filePath,false,true,true); if($filepath && $this->canWriteToDirectory($filePath)) { $flags = 0; if($replace) $flags = (FILE_APPEND | LOCK_EX); return (file_put_contents($filePath,$this->render($criteria,$offset,$limit)) > 0); } return false; } }