Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Source for file Center.php

Documentation is available at Center.php

  1. <?php
  2. // $Id: Center.php,v 1.2 2004/09/25 19:05:13 pmjones Exp $
  3.  
  4.  
  5. /**
  6. * This class implements a Text_Wiki_Parse to find lines marked for centering.
  7. * The line must start with "= " (i.e., an equal-sign followed by a space).
  8. *
  9. @author Paul M. Jones <pmjones@ciaweb.net>
  10. *
  11. @package Text_Wiki
  12. *
  13. */
  14.  
  15.     
  16.     
  17.     /**
  18.     * 
  19.     * The regular expression used to find source text matching this
  20.     * rule.
  21.     * 
  22.     * @access public
  23.     * 
  24.     * @var string 
  25.     * 
  26.     */
  27.     
  28.     var $regex = '/\n\= (.*?)\n/';
  29.     
  30.     /**
  31.     * 
  32.     * Generates a token entry for the matched text.
  33.     * 
  34.     * @access public
  35.     *
  36.     * @param array &$matches The array of matches from parse().
  37.     *
  38.     * @return delimited token number to be used as a placeholder in
  39.     *  the source text.
  40.     *
  41.     */
  42.     
  43.     function process(&$matches)
  44.     {
  45.         $start $this->wiki->addToken(
  46.             $this->rule,
  47.             array('type' => 'start')
  48.         );
  49.         
  50.         $end $this->wiki->addToken(
  51.             $this->rule,
  52.             array('type' => 'end')
  53.         );
  54.         
  55.         return "\n" $start $matches[1$end "\n";
  56.     }
  57. }
  58. ?>

Documentation generated on Mon, 11 Mar 2019 13:56:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.