本文整理汇总了PHP中sfOutputEscaper::unescape方法的典型用法代码示例。如果您正苦于以下问题:PHP sfOutputEscaper::unescape方法的具体用法?PHP sfOutputEscaper::unescape怎么用?PHP sfOutputEscaper::unescape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfOutputEscaper
的用法示例。
在下文中一共展示了sfOutputEscaper::unescape方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Méthode permettant d'afficher l'arbre à partir de celui passé en paramètre.
*
* @param ITree $tree
* @param array $options
* @param $key
*
* @return mixed|string
*/
public function render(ITree $tree, array $options, $key)
{
$this->defaults($tree, $tree->getRoot());
if ($key != null && !isset($options["baseId"])) {
$options["id"] = $this->options["id"] . "_" . $key;
$options["baseId"] = $this->options["id"];
} elseif ($key != null && isset($options["baseId"])) {
$options["id"] = $options["baseId"] . "_" . $key;
}
if ($key != null && isset($options["selected"])) {
$options["selected"] = isset($options["selected"][$key]) ? $options["selected"][$key] : "";
}
$options = array_merge($this->options, $options);
$build = function ($tree) use(&$build, &$options, $key) {
$output = is_string($options['rootOpen']) ? $options['rootOpen'] : $options['rootOpen']($tree);
$nodes = $tree instanceof ITreeViewerItem && $tree->isRoot() ? array($tree) : $tree;
/** @var ITreeViewerItem $node */
foreach ($nodes as $node) {
$output .= is_string($options['childOpen']) ? $options['childOpen'] : $options['childOpen']($node, $node->getType(), $key);
$output .= $options['nodeDecorator']($node);
if (count($node->getChildren()) > 0) {
$output .= $build($node->getChildren());
}
$output .= is_string($options['childClose']) ? $options['childClose'] : $options['childClose']($node);
}
return $output . (is_string($options['rootClose']) ? $options['rootClose'] : $options['rootClose']($tree));
};
return html_entity_decode(sfOutputEscaper::unescape(get_component("eitreeviewer", "displaySelectMode", array("root" => $tree, "html" => $build($tree->getRoot()), "options" => $options, "key" => $key, "tree" => $this))), ENT_QUOTES, "UTF-8");
}
示例2: get_theme_partial
/**
* Evaluates and returns a partial.
* The syntax is similar to the one of include_partial
*
* <b>Example:</b>
* <code>
* echo get_partial('mypartial', array('myvar' => 12345));
* </code>
*
* @param string $templateName partial name
* @param array $vars variables to be made accessible to the partial
*
* @return string result of the partial execution
* @see include_partial
*/
function get_theme_partial($templateName, $vars = array())
{
$context = sfContext::getInstance();
$actionName = '_' . $templateName;
$class = 'sfThemePartialView';
$current_theme = $context->getConfiguration()->getPluginConfiguration('sfThemePlugin')->getThemeManager()->getCurrentTheme();
$view = new $class($context, $current_theme, $actionName, '');
$view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars);
return $view->render();
}
示例3: trimComment
/**
* Trim comment to 30 characters
*
* @param string $comment
* @return string
*/
protected function trimComment($comment)
{
if (strlen($comment) > 30) {
$escape = sfConfig::get('sf_escaping_strategy');
if ($escape) {
$comment = sfOutputEscaper::unescape($comment);
}
$comment = substr($comment, 0, 30) . '...';
if ($escape) {
$comment = sfOutputEscaper::escape(sfConfig::get('sf_escaping_method'), $comment);
}
}
return $comment;
}
示例4: op_include_pager_navigation
/**
* Includes a navigation for paginated list
*
* @param sfPager $pager
* @param string $internal_uri
* @param array $options
*/
function op_include_pager_navigation($pager, $internal_uri, $options = array())
{
$uri = url_for($internal_uri);
if (isset($options['use_current_query_string']) && $options['use_current_query_string']) {
$options['query_string'] = sfContext::getInstance()->getRequest()->getCurrentQueryString();
$pageFieldName = isset($options['page_field_name']) ? $options['page_field_name'] : 'page';
$options['query_string'] = preg_replace('/' . $pageFieldName . '=\\d\\&*/', '', $options['query_string']);
unset($options['page_field_name']);
unset($options['use_current_query_string']);
}
if (isset($options['query_string'])) {
$options['link_options']['query_string'] = $options['query_string'];
unset($options['query_string']);
}
$params = array('pager' => $pager, 'internalUri' => $internal_uri, 'options' => new opPartsOptionHolder($options));
$pager = sfOutputEscaper::unescape($pager);
if ($pager instanceof sfReversibleDoctrinePager) {
include_partial('global/pagerReversibleNavigation', $params);
} else {
include_partial('global/pagerNavigation', $params);
}
}
示例5: DateTime
<td><?php
$fromDate = new DateTime($loan['from_date']);
echo $fromDate->format('d/m/Y');
?>
</td>
<td><?php
$toDate = new DateTime($loan['to_date']);
echo $toDate->format('d/m/Y');
?>
</td>
<td><?php
echo link_to(image_tag('blue_eyel.png'), url_for(array('module' => 'loan', 'action' => 'index', 'id' => $loan->getId())));
?>
</td>
<?php
if (in_array($loan->getId(), sfOutputEscaper::unescape($rights))) {
?>
<td><?php
echo link_to(image_tag('edit.png'), url_for(array('module' => 'loan', 'action' => 'edit', 'id' => $loan->getId())));
?>
</td>
<td><?php
echo link_to(image_tag('remove.png'), url_for(array('module' => 'loan', 'action' => 'delete', 'id' => $loan->getId())), array('method' => 'delete', 'confirm' => __('Are you sure?')));
?>
</td>
<?php
} else {
?>
<td> </td>
<td> </td>
<?php
示例6: image_tag
</td>
<td class="right">
<?php
if ($paragraph->getIsPhoto()) {
?>
<?php
echo image_tag($paragraph->getPathPhotoRu());
?>
<?php
} else {
?>
<p<?php
echo sfOutputEscaper::unescape($paragraph->getParagraphStyle());
?>
><?php
echo sfOutputEscaper::unescape($paragraph->getParagraphRuBr());
?>
</p>
<?php
}
?>
</td>
</tr>
<?php
}
// $paragraph
?>
<tr id="add_paragraph_before" <?php
if ($ll == 0) {
echo 'style="display: none;"';
示例7: foreach
<?php
if (isset($objects)) {
foreach ($objects as $object) {
if (sfOutputEscaper::unescape($object) instanceof EiFonction) {
echo sfOutputEscaper::unescape($object);
} else {
$object->printVersion();
}
}
}
示例8:
<?php
} else {
?>
<?php
echo $change->getOldValue(true);
?>
<?php
}
?>
</td>
<td>
<?php
if (ncChangeLogConfigHandler::shouldEscapeValues()) {
?>
<?php
echo sfOutputEscaper::unescape($change->getNewValue(true));
?>
<?php
} else {
?>
<?php
echo $change->getNewValue(true);
?>
<?php
}
?>
</td>
</tr>
<?php
}
?>
示例9: foreach
});
</script>
<div class="container">
<?php
foreach ($institutions as $institution) {
?>
<h2><?php
echo $institution->getFormatedName();
?>
</h2>
<div class="treelist">
<?php
$w = new sfWidgetCollectionList(array('choices' => array(), 'is_choose' => $is_choose));
$root = $tree = new Collections();
foreach ($institution->Collections as $item) {
$it = sfOutputEscaper::unescape($item);
$anc = $tree->getFirstCommonAncestor($it);
$anc->addChild($it);
$tree = $it;
}
echo $w->displayTree($root, '', array(), '', $sf_user);
?>
</div>
<?php
}
?>
<?php
if ($sf_user->isAtLeast(Users::MANAGER)) {
?>
<div class='new_link'><a <?php
示例10: array
$t->is(sfOutputEscaper::unescape('<strong>escaped!</strong>'), '<strong>escaped!</strong>', '::unescape() returns an unescaped string if the value to unescape is a string');
$t->is(sfOutputEscaper::unescape('<strong>échappé</strong>'), '<strong>échappé</strong>', '::unescape() returns an unescaped string if the value to unescape is a string');
$t->diag('::unescape() unescapes arrays');
$input = sfOutputEscaper::escape('esc_entities', array('foo' => '<strong>escaped!</strong>', 'bar' => array('foo' => '<strong>escaped!</strong>')));
$output = sfOutputEscaper::unescape($input);
$t->ok(is_array($output), '::unescape() returns an array if the input is a sfOutputEscaperArrayDecorator object');
$t->is($output['foo'], '<strong>escaped!</strong>', '::unescape() unescapes all elements of the original array');
$t->is($output['bar']['foo'], '<strong>escaped!</strong>', '::unescape() is recursive');
$t->diag('::unescape() unescapes objects');
$object = new OutputEscaperTestClass();
$input = sfOutputEscaper::escape('esc_entities', $object);
$output = sfOutputEscaper::unescape($input);
$t->isa_ok($output, 'OutputEscaperTestClass', '::unescape() returns the original object when a sfOutputEscaperObjectDecorator object is passed');
$t->is($output->getTitle(), '<strong>escaped!</strong>', '::unescape() unescapes all methods of the original object');
$t->is($output->title, '<strong>escaped!</strong>', '::unescape() unescapes all properties of the original object');
$t->is($output->getTitleTitle(), '<strong>escaped!</strong>', '::unescape() is recursive');
$t->isa_ok(sfOutputEscaperIteratorDecorator::unescape(sfOutputEscaper::escape('esc_entities', new DirectoryIterator('.'))), 'DirectoryIterator', '::unescape() unescapes sfOutputEscaperIteratorDecorator objects');
$t->diag('::unescape() does not unescape object marked as being safe');
$t->isa_ok(sfOutputEscaper::unescape(sfOutputEscaper::escape('esc_entities', new sfOutputEscaperSafe(new OutputEscaperTestClass()))), 'OutputEscaperTestClass', '::unescape() returns the original value if it is marked as being safe');
sfOutputEscaper::markClassAsSafe('OutputEscaperTestClass');
$t->isa_ok(sfOutputEscaper::unescape(sfOutputEscaper::escape('esc_entities', new OutputEscaperTestClass())), 'OutputEscaperTestClass', '::unescape() returns the original value if the object class is marked as being safe');
$t->isa_ok(sfOutputEscaper::unescape(sfOutputEscaper::escape('esc_entities', new OutputEscaperTestClassChild())), 'OutputEscaperTestClassChild', '::unescape() returns the original value if one of the object parent class is marked as being safe');
$t->diag('::unescape() do nothing to resources');
$fh = fopen(__FILE__, 'r');
$t->is(sfOutputEscaper::unescape($fh), $fh, '::unescape() do nothing to resources');
$t->diag('::unescape() unescapes mixed arrays');
$object = new OutputEscaperTestClass();
$input = array('foo' => 'bar', 'bar' => sfOutputEscaper::escape('esc_entities', '<strong>bar</strong>'), 'foobar' => sfOutputEscaper::escape('esc_entities', $object));
$output = array('foo' => 'bar', 'bar' => '<strong>bar</strong>', 'foobar' => $object);
$t->is(sfOutputEscaper::unescape($input), $output, '::unescape() unescapes values with some escaped and unescaped values');
示例11: op_mobile_page_title
/**
* Set the op_mobile_header slot
*
* @param string $title
* @param string $subtitle
*/
function op_mobile_page_title($title, $subtitle = '')
{
$params = array('title' => sfOutputEscaper::unescape($title), 'subtitle' => sfOutputEscaper::unescape($subtitle));
slot('op_mobile_header', get_partial('global/partsPageTitle', $params));
}
示例12: checkCacheKey
/**
* Before checking cache key - saves passed tags
*
* @see parent::checkCacheKey()
* @param array $parameters An array of parameters
* @return string The cache key
*/
public function checkCacheKey(array &$parameters)
{
$tagsKey = 'sf_cache_tags';
$this->temporaryContentTags = null;
if (isset($parameters[$tagsKey])) {
$tags = true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($parameters[$tagsKey]) : $parameters[$tagsKey];
unset($parameters[$tagsKey]);
if ($tags) {
$this->temporaryContentTags = $tags;
}
}
return parent::checkCacheKey($parameters);
}
示例13:
?>
" method="post" enctype="multipart/form-data">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="6" style="border-radius: 10px;border: 1px solid #D3D3D3;">
<tr align="right">
<td colspan="2" align="left" class="blue">Datos del Pago</td>
</tr>
<tr>
<td colspan="2">
<?php
echo $form->renderGlobalErrors();
?>
</td>
</tr>
<?php
echo sfOutputEscaper::unescape($form['tipo_tdc']->renderRow());
?>
<?php
echo $form['vence']->renderRow();
?>
<?php
echo $form['tdc']->renderRow();
?>
<?php
echo $form['banco']->renderRow();
?>
<?php
示例14: link_to
<?php
} else {
?>
<?php
echo $loan->getToDateFormatted();
?>
<?php
}
?>
</td>
<td><?php
echo link_to(image_tag('blue_eyel.png'), 'loan/view?id=' . $loan->getId(), 'class=view_loan');
?>
</td>
<?php
if (in_array($loan->getId(), sfOutputEscaper::unescape($rights)) || $sf_user->isA(Users::ADMIN)) {
?>
<td><?php
echo link_to(image_tag('edit.png'), 'loan/edit?id=' . $loan->getId(), 'class=edit_loan');
?>
</td>
<?php
} else {
?>
<td> </td>
<td> </td>
<?php
}
?>
</tr>
<?php
示例15: __
<div class="page">
<div class="warn_message">
<p>
<?php
echo __('The record that you are trying to delete has children. If you delete it, every children will be deleted too!');
?>
</p>
<br />
<span class="remove_confirm">
<?php
echo image_tag('remove.png');
?>
<?php
echo link_to("Delete it anyway", sfOutputEscaper::unescape($link_delete));
?>
</span>
<?php
echo link_to("Cancel", sfOutputEscaper::unescape($link_cancel));
?>
<br /><br />
</div>
</div>