Hi, I just want to know if anyone sees a problem with the fallowing code. It's a method in a class that takes care of templating. I'm completely rewriteing the backend for our website because PHP is crashing for some odd reason, see this thread. I think it may be related to this method but not sure. Buy anyway, I would like to reuse this code in the new backend, cleaned up of course. I just wanted to know if anyone sees something wrong with using it, specificly the output buffering. Thanks
function Load()
{
if (is_file($this->_file)) {
if (is_readable($this->_file)) {
// Get Template
ob_start();
include($this->_file);
$template = ob_get_contents();
ob_end_clean();
// Get the head, top, and bottom.
$re = '/(' . preg_quote($this->_head_start) . '){1}(.*)(' . preg_quote($this->_head_end) . '){1}/is';
(!preg_match($re, $template, $matches)
? $this->addError('Error Msg - shortend to fit on screen. (phpBuilder.com)')
: $this->_head_content = $matches[2]
);
$re = '/(' . preg_quote($this->_top_start) . '){1}(.*)(' . preg_quote($this->_top_end) . '){1}/is';
(!preg_match($re, $template, $matches)
? $this->addError('Error Msg - shortend to fit on screen. (phpBuilder.com)')
: $this->_top_content = $matches[2]
);
$re = '/(' . preg_quote($this->_bottom_start) . '){1}(.*)(' . preg_quote($this->_bottom_end) . '){1}/is';
(!preg_match($re, $template, $matches)
? $this->addError('Error Msg - shortend to fit on screen. (phpBuilder.com)')
: $this->_bottom_content = $matches[2]
);
} else
$this->addError('Error Msg - shortend to fit on screen. (phpBuilder.com)');
} else
$this->addError('Error Msg - shortend to fit on screen. (phpBuilder.com)');
}