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

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