本文整理汇总了PHP中rex_file::getOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_file::getOutput方法的具体用法?PHP rex_file::getOutput怎么用?PHP rex_file::getOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_file
的用法示例。
在下文中一共展示了rex_file::getOutput方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replaceVars
static function replaceVars($template, $er = array())
{
$r = rex_extension::registerPoint(new rex_extension_point('YFORM_EMAIL_BEFORE_REPLACEVARS', ['template' => $template, 'search_replace' => $er, 'status' => false]));
$template = $r['template'];
$er = $r['search_replace'];
$status = $r['status'];
if ($status) {
return true;
}
$er['REX_SERVER'] = rex::getServer();
$er['REX_ERROR_EMAIL'] = rex::getErrorEmail();
$er['REX_SERVERNAME'] = rex::getServerName();
$er['REX_NOTFOUND_ARTICLE_ID'] = rex_article::getNotfoundArticleId();
$er['REX_ARTICLE_ID'] = rex_article::getCurrentId();
$template['body'] = rex_var::parse($template['body'], '', 'yform_email_template', $er);
$template['body_html'] = rex_var::parse($template['body_html'], '', 'yform_email_template', $er);
// rex_vars bug: sonst wird der Zeilenumbruch entfernt - wenn DATA_VAR am Ende einer Zeile
if (rex_string::versionCompare(rex::getVersion(), '5.0.1', '<')) {
$template['body'] = str_replace("?>\r", "?>\r\n\r", $template['body']);
$template['body'] = str_replace("?>\n", "?>\n\r\n", $template['body']);
$template['body_html'] = str_replace("?>\r", "?>\r\n\r", $template['body_html']);
$template['body_html'] = str_replace("?>\n", "?>\n\r\n", $template['body_html']);
}
$template['body'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body', $template['body']));
$template['body_html'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body_html', $template['body_html']));
return $template;
}
示例2: getParseOutput
protected function getParseOutput($content)
{
return rex_file::getOutput(rex_stream::factory('rex-var-test', rex_var::parse($content)));
}
示例3: testGetOutput
public function testGetOutput()
{
$file = $this->getPath('test.php');
rex_file::put($file, 'a<?php echo "b";');
$this->assertEquals('ab', rex_file::getOutput($file), 'getOutput() returns the executed content');
}
示例4: foreach
<?php
$content = rex_file::getOutput(rex_path::plugin('be_style', 'redaxo', 'assets/css/styles.css'));
preg_match_all('@\\.rex-icon-(\\w+):before@im', $content, $matches, PREG_SET_ORDER);
$icons_used = '';
if (count($matches) > 0) {
$list = [];
foreach ($matches as $match) {
$list[$match[1]] = '<li><i class="rex-icon rex-icon-' . $match[1] . '"></i> rex-icon-' . $match[1] . '</li>';
}
ksort($list);
$icons_used = '<ul class="rex-list-inline">' . implode('', $list) . '</ul>';
}
preg_match_all('@\\.fa-(\\w+):before@im', $content, $matches, PREG_SET_ORDER);
$icons_complete = '';
if (count($matches) > 0) {
$list = [];
foreach ($matches as $match) {
$list[$match[1]] = '<li><i class="fa fa-' . $match[1] . '"></i> fa-' . $match[1] . '</li>';
}
ksort($list);
$icons_complete = '<ul class="rex-list-inline">' . implode('', $list) . '</ul>';
}
$fragment = new rex_fragment();
$fragment->setVar('content', '<h3>REDAXO Icons</h3>' . $icons_used, false);
echo $fragment->parse('core/page/section.php');
$fragment = new rex_fragment();
$fragment->setVar('content', '<h3>Font-Awesome Icons</h3>' . $icons_complete, false);
echo $fragment->parse('core/page/section.php');