本文整理匯總了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');