当前位置: 首页>>代码示例>>PHP>>正文


PHP simple_format_text函数代码示例

本文整理汇总了PHP中simple_format_text函数的典型用法代码示例。如果您正苦于以下问题:PHP simple_format_text函数的具体用法?PHP simple_format_text怎么用?PHP simple_format_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了simple_format_text函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPanelContent

    /**
     * @see sfWebDebugPanel
     */
    public function getPanelContent()
    {
        $this->compiler = sfSassCompilerDefault::getInstance(sfContext::getInstance()->getEventDispatcher());
        $status = $this->compiler->getStatus();
        $stdout = $this->compiler->getStdOut();
        $cmd = $this->compiler->getCommand();
        $content = <<<DEBUG
    <h2>Command</h2>
    <p style="display: block; border: 1px solid black; padding: 5px; background-color: white;">{command}</p>
    <h2>Status</h2>
    <p style="display: block; border: 1px solid black; padding: 5px; background-color: white;">{status}</p>
DEBUG;
        if (!empty($stdout)) {
            $content .= <<<STDOUT
    <h2>Output</h2>
    <div style="display: block; border: 1px solid black; padding: 5px; background-color: white;">
    {stdout}
    </div>
STDOUT;
        }
        require_once sfConfig::get('sf_symfony_lib_dir') . '/helper/TextHelper.php';
        $content = strtr($content, array('{command}' => htmlentities($cmd), '{stdout}' => simple_format_text(htmlentities($stdout)), '{status}' => $status));
        if (!empty($stdout)) {
            $this->setStatus(preg_match('/error /mi', $stdout) === 1 ? sfLogger::ERR : sfLogger::WARNING);
        } else {
            $this->setStatus(sfLogger::INFO);
        }
        return $content . "<br/>";
    }
开发者ID:vicb,项目名称:sfSassyCssPlugin,代码行数:32,代码来源:sfSassyWebDebugPanel.class.php

示例2: link_to

  <?php 
}
?>
  <?php 
if ($project['Client']['id']) {
    ?>
    | for <?php 
    echo link_to($project['Client'], 'contacts_show', $project['Client']);
    ?>
  <?php 
}
?>
  </p>

  <?php 
echo simple_format_text($project['description']);
?>

  <hr />

  <?php 
include_partial('notes/show_notes', array('notes' => $project->getNotesList(), 'note_form' => $note_form));
?>

</div> <!-- /grid_8 -->

<div class="sidebar grid_4">

  <div class="milestones box">
    <h2>
      Milestones
开发者ID:nurihan007,项目名称:amaranto,代码行数:31,代码来源:showSuccess.php

示例3:

$t->is(excerpt_text("This is a beautiful morning", "morning", 5), "...iful morning", 'text_excerpt() creates an excerpt of a text');
$t->is(excerpt_text("This is a beautiful morning", "morning", 5, '...', true), "... morning", 'text_excerpt() takes a fifth argument allowing excerpt on whitespace');
$t->is(excerpt_text("This is a beautiful morning", "beautiful", 5, '...', true), "... a beautiful ...", 'text_excerpt() takes a fifth argument allowing excerpt on whitespace');
$t->is(excerpt_text("This is a beautiful morning", "This", 5, '...', true), "This is ...", 'text_excerpt() takes a fifth argument allowing excerpt on whitespace');
$t->is(excerpt_text("This is a beautiful morning", "day"), '', 'text_excerpt() does nothing if the search string is not in input');
// wrap_text()
$t->diag('wrap_text()');
$line = 'This is a very long line to be wrapped...';
$t->is(wrap_text($line), "This is a very long line to be wrapped...\n", 'wrap_text() wraps long lines with a default of 80');
$t->is(wrap_text($line, 10), "This is a\nvery long\nline to be\nwrapped...\n", 'wrap_text() takes a line length as its second argument');
$t->is(wrap_text($line, 5), "This\nis a\nvery\nlong\nline\nto be\nwrapped...\n", 'wrap_text() takes a line length as its second argument');
// simple_format_text()
$t->diag('simple_format_text()');
$t->is(simple_format_text("crazy\r\n cross\r platform linebreaks"), "<p>crazy\n<br /> cross\n<br /> platform linebreaks</p>", 'text_simple_format() replaces \\n by <br />');
$t->is(simple_format_text("A paragraph\n\nand another one!"), "<p>A paragraph</p>\n\n<p>and another one!</p>", 'text_simple_format() replaces \\n\\n by <p>');
$t->is(simple_format_text("A paragraph\n With a newline"), "<p>A paragraph\n<br /> With a newline</p>", 'text_simple_format() wrap all string with <p>');
// text_strip_links()
$t->diag('text_strip_links()');
$t->is(strip_links_text("<a href='almost'>on my mind</a>"), "on my mind", 'text_strip_links() strips all links in input');
// auto_link_text()
$t->diag('auto_link_text()');
$email_raw = 'fabien.potencier@symfony-project.com';
$email_result = '<a href="mailto:' . $email_raw . '">' . $email_raw . '</a>';
$link_raw = 'http://www.google.com';
$link_result = '<a href="' . $link_raw . '">' . $link_raw . '</a>';
$link2_raw = 'www.google.com';
$link2_result = '<a href="http://' . $link2_raw . '">' . $link2_raw . '</a>';
$t->is(auto_link_text('hello ' . $email_raw, 'email_addresses'), 'hello ' . $email_result, 'auto_link_text() converts emails to links');
$t->is(auto_link_text('Go to ' . $link_raw, 'urls'), 'Go to ' . $link_result, 'auto_link_text() converts absolute URLs to links');
$t->is(auto_link_text('Go to ' . $link_raw, 'email_addresses'), 'Go to ' . $link_raw, 'auto_link_text() takes a second parameter');
$t->is(auto_link_text('Go to ' . $link_raw . ' and say hello to ' . $email_raw), 'Go to ' . $link_result . ' and say hello to ' . $email_result, 'auto_link_text() converts emails and URLs if no second argument is given');
开发者ID:googlecode-mirror,项目名称:orso,代码行数:31,代码来源:TextHelperTest.php

示例4: foreach

<?php 
foreach ($activities as $activity) {
    ?>
  <div class="issue-activity">
    <p class="activity-timestamp">
      <strong><?php 
    echo $activity->verb;
    ?>
 by <?php 
    echo $activity->CreatedBy;
    ?>
</strong>
      <small><?php 
    echo $activity->created_at;
    ?>
</small>
    </p>
    <blockquote class="activity-changes">
      <?php 
    echo simple_format_text($activity->changes);
    ?>
    </blockquote>
    <?php 
    echo simple_format_text($activity->body);
    ?>
  </div>
<?php 
}
?>
</div> <!-- /issue-history -->
开发者ID:nurihan007,项目名称:amaranto,代码行数:30,代码来源:_activities.php

示例5: if

        <?php if ($sf_user->hasCredential('superuser')): ?>
          <?php echo link_to('Delete', 'email_recipient_delete', $recipient, array( 'method' => 'delete',  'confirm' => 'Are You Sure?', 'class' => '' )) ?>
        <?php endif; ?>   


      </td>
    </tr>

<div id="<?php echo $recipient->id ?>" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel"><?php echo $ds_class_letter->getSubject() ?></h3>
  </div>
  <div class="modal-body">
    <p><?php echo simple_format_text( $recipient->getBody() ) ?></p>
  </div>
  <!--
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <button class="btn btn-primary">Save changes</button>
  </div>-->
</div>

    <?php endforeach; ?>
  </tbody>
  <?php if ($recipients->count() == 0): ?>
  <tfoot>
    <tr>
      <th colspan="3">
        -
开发者ID:romankallweit,项目名称:swingmachine,代码行数:30,代码来源:_list_recipients_sent.php

示例6: simple_format_text

">           
 <img src="/uploads/jobs/<?php 
    echo $JobeetJob->getLogo();
    ?>
"  alt="<?php 
    echo $JobeetJob->getCompany();
    ?>
 logo" /></a>
 </div>
 <?php 
}
?>
      
 <div class="description">        
 <?php 
echo simple_format_text($JobeetJob->getDescription());
?>
      </div>      
 <h4>How to apply?</h4>     
 <p class="how_to_apply">
 <?php 
echo $JobeetJob->getHowToApply();
?>
</p>     
  <div class="meta">
  <small>publicado el: <?php 
echo $JobeetJob->getCreatedAt('d/m/Y');
?>
  </small></div>
<div style="padding: 20px 0"><a href="<?php 
echo url_for('job_edit', $JobeetJob);
开发者ID:rdi0r,项目名称:dreamrc,代码行数:31,代码来源:showSuccess.php

示例7: strtotime

<div class="info-block">
  <dl>
    <dt>Subject</dt>
    <dd><?php echo $ds_class_letter->getSubject() ?></dd>

    <dt>From</dt>
    <dd><?php echo $ds_class_letter->getFromAsString() ?></dd>

    <dt>Class</dt>
    <dd><?php echo $ds_class_letter->getClass() ?></dd>

    <dt>Sent at</dt>
    <dd><?php echo false !== strtotime($ds_class_letter->getSentAt()) ? date('d.m.Y H:i:s', strtotime($ds_class_letter->getSentAt())) : $ds_class_letter->getSentAt() ?></dd>

    <dt>To teachers</dt>
    <dd><?php echo $ds_class_letter->getToTeachers() ?></dd>

    <dt>Sent to</dt>
    <dd><?php echo $ds_class_letter->getSentToAsString() ?></dd>

    <dt>Body</dt>
    <dd>
      <span class="monospace">
        <?php echo simple_format_text($ds_class_letter->getBody()) ?>
      </span>  
    </dd>

  </dl>
</div>
开发者ID:romankallweit,项目名称:swingmachine,代码行数:29,代码来源:_show.php

示例8: use_helper

use_helper('Text', 'Javascript');
if (isset($poll)) {
    ?>
<div id="cmp_poll_<?php 
    echo $poll->getId();
    ?>
">
  <h2><?php 
    echo $poll->getTitle();
    ?>
</h2>
  <?php 
    if ($poll->getDescription()) {
        ?>
    <?php 
        echo simple_format_text($poll->getDescription());
        ?>
  <?php 
    }
    ?>
  <?php 
    echo form_remote_tag(array('url' => '@sf_propel_polls_vote', 'update' => 'cmp_poll_' . $poll->getId()));
    ?>
    <?php 
    include_partial('sfPolls/poll_form_elements', array('poll' => $poll));
    ?>
  </form>
</div>
<?php 
}
开发者ID:sgrove,项目名称:cothinker,代码行数:30,代码来源:_poll_form.php

示例9: __

<fieldset id="sf_fieldset_________" class="">
<h2><?php 
echo __('解决方案');
?>
</h2>

<div class="form-row">
  <?php 
$i = 0;
foreach ($solutions as $solution) {
    $i++;
    ?>
    <div class="solution" style="margin-bottom:10px;">
      <?php 
    echo count($solutions) > 1 ? $i . "." : "";
    echo simple_format_text($solution->getSolution());
    ?>
<br/>
    </div>    
  <?php 
}
?>
     
</div>


</fieldset>    

<ul class="sf_admin_actions">
  <li><?php 
echo button_to(__('返回列表'), 'question/list?id=' . $question->getId(), array('class' => 'sf_admin_action_list'));
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:31,代码来源:showSuccess.php

示例10: strstr

if ($website = $comment->getWebsite()) {
    ?>
    <a href="
            <?php 
    echo strstr($website, 'http://') ? $website : 'http://' . $website;
    ?>
       "><?php 
    echo $comment->getName();
    ?>
</a>
    <?php 
} else {
    ?>
      <?php 
    echo $comment->getName();
    ?>
    <?php 
}
?>
    -
    <?php 
echo distance_of_time_in_words($comment->getDateTimeObject('created_at')->format('U'), $article->getDateTimeObject('published_at')->format('U'));
?>
 later
  </dt>
  <dd>
    <?php 
echo simple_format_text($comment->getMessage());
?>
  </dd>
</dl>
开发者ID:kbond,项目名称:zsBlogPlugin,代码行数:31,代码来源:_comment.php

示例11: use_helper

<?php use_helper('Text') ?>

<div class="formulario">
<h1><?php echo $proyecto->getNombre() ?></h1>
<h3><?php echo $proyecto->getUrl() ?></h3>

<div class="descripcion"><?php echo simple_format_text($proyecto->getDescripcion()) ?>
</div>

<div class="descripcion">
<table>
	<tr>
		<th style="width:200px">Usuarios asociados</th>

		<td colspan="4">
		<table>
		<?php foreach ($proyecto->getUsers() as $usuario): ?>
			<tr>
				<td colspan="2"><?php echo $usuario?></td>
			</tr>
			<?php endforeach; ?>
		</table>

		<div id="ficheros"></div>
		</td>
	</tr>
</table>
</div>
<div class="meta"><small>created on <?php echo $proyecto->getDateTimeObject('created_at')->format('m/d/Y') ?></small>
</div>
开发者ID:nhpatt,项目名称:gestor-de-estados,代码行数:30,代码来源:showSuccess.php

示例12: url_for

              </a>
            </li>
            <li class="pull-left">
              <a href="#" class="btn btn-mini comment-deleter" rel="tooltip" title="delete" data-delete-uri="<?php 
            echo url_for('@comments-delete?id=' . $ticket->getId() . '&comment=' . $comment->getId());
            ?>
">
                <i class="icon-remove"></i>
              </a>
            </li>
          </ul>
        <?php 
        }
        ?>
        <?php 
        echo Helpdesk::replaceTicketMentionsWithLinks(Helpdesk::replaceTicketRepeaterMentionsWithLinks(simple_format_text($comment->getText())));
        ?>

        <?php 
        if ($attachment = $comment->getAttachment()) {
            ?>
<p>
          <a href="/uploads/comment-attachments/<?php 
            echo $attachment;
            ?>
" target="_blank" class="btn btn-link">
            <span class="icon icon-download"></span>
            <?php 
            echo $attachment;
            ?>
          </a>
开发者ID:vik0803,项目名称:helpdesk,代码行数:31,代码来源:showSuccess.php

示例13: use_helper

use_helper('Date', 'Text');
?>

<?php 
slot('sidebar');
include_partial('menu', array('project' => $project));
end_slot();
?>

<h1><?php 
echo $project->getName();
?>
</h1>
<?php 
echo image_tag('divider.png', 'class=divider');
echo simple_format_text($project->getDescription());
?>
<dl class="prop">
    <dt>License:</dt>
    <dd><?php 
echo link_to($project->getLicense()->getName(), $project->getLicense()->getUrl(), 'target=_blank');
?>
</dd>
    <?php 
if ($project->getWiki()) {
    ?>
    <dt>Wiki:</dt>
    <dd><?php 
    echo link_to(null, $project->getWiki(), 'target=_blank');
    ?>
</dd>
开发者ID:hoydaa,项目名称:hoydaa.org,代码行数:31,代码来源:showSuccess.php

示例14: html_entity_decode

<?php 
echo html_entity_decode($notes->getBreadcrumbs());
?>
&nbsp;&nbsp;<?php 
if (!$notes->isRoot()) {
    echo link_to("(Edit)", "notes/edit?id=" . $notes->getId());
}
?>
<hr>
<h1><?php 
echo $notes->getName();
?>
</h1>
<?php 
echo simple_format_text($notes->getContent());
?>
<hr>

<?php 
echo form_tag("notes/view?id=" . $notes->getId(), array("method" => "get"));
?>
View <input name=levels size=1 value=<?php 
echo $levels;
?>
><input type=submit name=submit value=Levels />
</form>
<br>
<?php 
echo form_tag_for(new NotesForm(), "notes/massoper");
?>
开发者ID:jaspertomas,项目名称:tmcprogram_tacloban,代码行数:30,代码来源:viewSuccess.php

示例15: use_helper

<?php use_helper('Text') ?>

<div class="formulario">
<h1><?php echo $linea_base->getNombre() ?></h1>
<h2><?php echo $linea_base->getId() ?></h2>
<h3><?php echo $linea_base->getProyecto() ?></h3>
<div class="descripcion"><?php echo simple_format_text($linea_base->getDescripcion()) ?>
</div>

<div class="meta"><small>created on <?php echo $linea_base->getDateTimeObject('created_at')->format('m/d/Y') ?></small>
</div>
<table class="form">
	<tr>
		<td>Versiones asociadas</td>
		<td colspan="3"><?php foreach ($linea_base->getVersiones() as $version): ?>
		<table>
			<tr>
				<td><?php echo $version->getArtefacto() ?></td>
				<td><?php echo $version->getNombre() ?></td>
				<td><?php echo $version->getDescripcion() ?></td>
			</tr>
		</table>
		<?php  endforeach; ?>
		<div id="ficheros"></div>
		</td>
	</tr>
</table>
<div style="padding: 20px 0"><a
	href="<?php echo url_for('lineaBase/edit?id='.$linea_base->getId().'&proyectoId='.$linea_base->getProyecto()->getId()) ?>">
Editar l&iacute;nea base </a>
<p />
开发者ID:nhpatt,项目名称:gestor-de-estados,代码行数:31,代码来源:showSuccess.php


注:本文中的simple_format_text函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。