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

Class: Text_Wiki_Parse_Table

Source Location: /Text_Wiki_Mediawiki-0.2.0/Text/Wiki/Parse/Mediawiki/Table.php

Class Overview

Text_Wiki_Parse
   |
   --Text_Wiki_Parse_Table

Table rule parser class for Mediawiki.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 bertrand Gugger

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 34]
Table rule parser class for Mediawiki.


[ Top ]


Class Variables

$regex =  '#^\{\|(.*?)(?:^\|\+(.*?))?(^(?:((?R))|.)*?)^\|}#msi'

[line 44]

The regular expression used to parse the source text and find matches conforming to this rule. Used by the parse() method.
  • See: parse()
  • Access: public

Type:   string


[ Top ]

$regexCells =
    '#((?:^\||^!|\|\||!!|\G))(?:([^|\n]*?)\|(?!\|))?(?:\n*)(.+?)(?:\n*)(?=^\||^!|\|\||!!|\z)#msi'

[line 66]

The regular expression used in third stage to find rows's cells used by processRows() to call back processCells()

Type:   string


[ Top ]

$regexRows =  '#(?:^([|!])-|\G)(.*?)^(.+?)(?=^[|!]-|\z)#msi'

[line 55]

The regular expression used in second stage to find table's rows used by process() to call back processRows()

Type:   string


[ Top ]



Method Detail

process   [line 141]

string process( array &$matches)

Generates a replacement for the matched text. Returned token options are:

'type' => 'table_start' : the start of a bullet list 'table_end' : the end of a bullet list 'row_start' : the start of a number list 'row_end' : the end of a number list 'cell_start' : the start of item text (bullet or number) 'cell_end' : the end of item text (bullet or number) 'caption_start' : the start of associated caption 'caption_end' : the end of associated caption

'level' => the table nesting level (starting zero) ('table_start')

'rows' => the number of rows in the table ('table_start')

'cols' => the number of columns in the table or rows ('table_start' and 'row_start')

'span' => column span ('cell_start')

'row_span' => row span ('cell_start')

'attr' => header optional attribute flag ('row_start' or 'cell_start')

'format' => table, row or cell optional styling ('xxx_start')

  • Return: the original text with tags replaced by delimited tokens which point to the the token array containing their type and definition
  • Access: public

Parameters:

array   &$matches   —  The array of matches from parse().

[ Top ]

processCells   [line 252]

string processCells( array &$matches)

Generates a replacement for the matched cells. Token options are:

'type' => 'cell_start' : the start of a row 'cell_end' : the end of a row

'order' => the cell order in the row

'cols' => the count of cells in the row

'span' => column span

'row_span' => row span

'attr' => header optional attribute flag

'format' => cell optional styling

  • Return: 2 delimited tokens pointing the cell params and containing the block of text between the tags
  • Access: public

Parameters:

array   &$matches   —  The array of matches from processRows() callback.

[ Top ]

processRows   [line 202]

string processRows( array &$matches)

Generates a replacement for the matched rows. Token options are:

'type' => 'row_start' : the start of a row 'row_end' : the end of a row

'order' => the row order in the table

'cols' => the count of cells in the row

'attr' => header optional attribute flag

'format' => row optional styling

  • Return: 2 delimited tokens pointing the row params and containing the cells-parsed block of text between the tags
  • Access: public

Parameters:

array   &$matches   —  The array of matches from process() callback.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:32:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.