[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/helper/ -> TextHelper.php (sommaire)

TextHelper.

Author: Fabien Potencier <fabien.potencier@symfony-project.com>
Author: David Heinemeier Hansson
Version: SVN: $Id: TextHelper.php 3408 2007-02-06 08:05:36Z fabien $
Poids: 207 lignes (7 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 9 fonctions

  truncate_text()
  highlight_text()
  excerpt_text()
  wrap_text()
  simple_format_text()
  auto_link_text()
  strip_links_text()
  _auto_link_urls()
  _auto_link_email_addresses()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

truncate_text($text, $length = 30, $truncate_string = '...', $truncate_lastspace = false)   X-Ref
Truncates +text+ to the length of +length+ and replaces the last three characters with the +truncate_string+
if the +text+ is longer than +length+.


highlight_text($text, $phrase, $highlighter = '<strong class="highlight">\\1</strong>')   X-Ref
Highlights the +phrase+ where it is found in the +text+ by surrounding it like
<strong class="highlight">I'm a highlight phrase</strong>. The highlighter can be specialized by
passing +highlighter+ as single-quoted string with \1 where the phrase is supposed to be inserted.
N.B.: The +phrase+ is sanitized to include only letters, digits, and spaces before use.


excerpt_text($text, $phrase, $radius = 100, $excerpt_string = '...')   X-Ref
Extracts an excerpt from the +text+ surrounding the +phrase+ with a number of characters on each side determined
by +radius+. If the phrase isn't found, nil is returned. Ex:
excerpt("hello my world", "my", 3) => "...lo my wo..."


wrap_text($text, $line_width = 80)   X-Ref
Word wrap long lines to line_width.


simple_format_text($text, $options = array()   X-Ref
Pas de description

auto_link_text($text, $link = 'all', $href_options = array()   X-Ref
Turns all urls and email addresses into clickable links. The +link+ parameter can limit what should be linked.
Options are :all (default), :email_addresses, and :urls.

Example:
auto_link("Go to http://www.symfony-project.com and say hello to fabien.potencier@example.com") =>
Go to <a href="http://www.symfony-project.com">http://www.symfony-project.com</a> and
say hello to <a href="mailto:fabien.potencier@example.com">fabien.potencier@example.com</a>

strip_links_text($text)   X-Ref
Pas de description

_auto_link_urls($text, $href_options = array()   X-Ref
Turns all urls into clickable links.


_auto_link_email_addresses($text)   X-Ref
Turns all email addresses into clickable links.




Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7