本文整理匯總了PHP中Render::attach方法的典型用法代碼示例。如果您正苦於以下問題:PHP Render::attach方法的具體用法?PHP Render::attach怎麽用?PHP Render::attach使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Render
的用法示例。
在下文中一共展示了Render::attach方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public function run()
{
$reader = new Reader();
$render = new Render();
if (Index::requireIndexing()) {
$format = $render->attach(new Index());
$reader->open(Config::xml_file());
$render->execute($reader);
$render->detach($format);
}
$render->attach($this->format);
$reader->open(Config::xml_file());
$render->execute($reader);
}
示例2: parse
public final function parse($xml)
{
$parsed = "";
$reader = new Reader();
$render = new Render();
$reader->XML("<notatag>" . $xml . "</notatag>");
$this->appendToBuffer = true;
$render->attach($this);
$render->execute($reader);
$this->appendToBuffer = false;
$parsed = $this->buffer;
$this->buffer = "";
return $parsed;
}
示例3: Reader
$reader = new Reader();
}
return $reader;
}
$render = new Render();
$reader = make_reader();
// Set reader LIBXML options
$readerOpts = 0;
if (Config::process_xincludes()) {
$readerOpts |= LIBXML_XINCLUDE;
}
// Indexing
if (Index::requireIndexing()) {
v("Indexing...", VERBOSE_INDEXING);
// Create indexer
$format = $render->attach(new Index());
$reader->open(Config::xml_file(), NULL, $readerOpts);
$render->execute($reader);
$render->detach($format);
v("Indexing done", VERBOSE_INDEXING);
} else {
v("Skipping indexing", VERBOSE_INDEXING);
}
foreach ((array) Config::package() as $package) {
$factory = Format_Factory::createFactory($package);
// Default to all output formats specified by the package
if (count(Config::output_format()) == 0) {
Config::set_output_format((array) $factory->getOutputFormats());
}
// Register the formats
foreach (Config::output_format() as $format) {