* @package patTemplate * @subpackage Examples * @link http://www.php-tools.de */ /** * Main examples prepend file, needed *only* for the examples framework! */ include_once 'patExampleGen/prepend.php'; // EXAMPLE START ------------------------------------------------------ /** * patErrorManager class */ require_once $neededFiles['patErrorManager']; /** * patTemplate */ require_once $neededFiles['patTemplate']; $tmpl = &new patTemplate(); $tmpl->setRoot('mysql://root:@localhost/test'); // It's possible to directly specify a query // $result = $tmpl->readTemplatesFromInput("SELECT content FROM templates WHERE id='table'", 'DB'); // Or use an XPath-like syntax $result = $tmpl->readTemplatesFromInput('templates[@id=table]/@content', 'DB'); if (patErrorManager::isError($result)) { $result->getMessage(); } $tmpl->setAttribute('foo', 'visibility', 'hidden'); $rows = array( array( '