Entwickler.TextHelper History

Hide minor edits - Show changes to markup

 
 
April 01, 2011, at 11:42 PM by tthelen -
Added lines 1-2:

(:redirect 'http://docs.studip.de/develop/Entwickler/TextHelper':)

 
 
March 16, 2010, at 03:18 PM by mriehe -
Changed line 11 from:

(:source lang=htm linenum:)[@

to:

(:source lang=php linenum:)[@

 
 
March 16, 2010, at 03:18 PM by mriehe -
Changed line 11 from:

(:source lang=xhtml linenum:)[@

to:

(:source lang=htm linenum:)[@

 
 
March 16, 2010, at 03:18 PM by mriehe -
Changed line 11 from:

(:source lang=php linenum:)[@

to:

(:source lang=xhtml linenum:)[@

 
 
March 16, 2010, at 03:17 PM by mriehe -
Changed lines 11-12 from:

(:source lang=html linenum:)[@

to:

(:source lang=php linenum:)[@ <? // Beispiel für 2 Tabellenzeilen ?>

Added lines 16-29:
  </tr>

<? endforeach ?>

<? // Komplexeres Beispiel für verschachtelte Wechsel ?> <? foreach($items as $item) : ?>

   <tr class="<?= TextHelper::cycle(array("even", "odd", "name" => "row_class")) ?>">
     <td>
       <? foreach ($item->values as $value) : ?>
        <span style="color:<?= TextHelper::cycle(array("red", "green", "blue", "name" => "colors")) : ?>">
           <?= $value ?>
         </span>
       <? endforeach ?>
      <? TextHelper::reset_cycle("colors") ?>
     </td>
 
 
March 16, 2010, at 03:14 PM by mriehe -
Changed line 11 from:

(:source lang=php linenum:)[@

to:

(:source lang=html linenum:)[@

 
 
March 16, 2010, at 03:13 PM by mriehe -
Deleted lines 3-5:

camelize($word)

Returns a camelized string from a lower case and underscored string by replacing slash with underscore and upper-casing each letter preceded by an underscore.

 
 
March 16, 2010, at 03:12 PM by mriehe -
Changed lines 6-7 from:
to:

Returns a camelized string from a lower case and underscored string by replacing slash with underscore and upper-casing each letter preceded by an underscore.

Added lines 9-11:

Creates a Cycle object whose +__toString method cycles through elements of an array every time it is called.

You can use named cycles to allow nesting in loops. Passing a single array as the only parameter with a <tt>name</tt> key will create a named cycle. You can manually reset a cycle by calling reset_cycle and passing the name of the cycle.

 
 
March 16, 2010, at 03:07 PM by mriehe -
Added line 7:
Added lines 9-18:

Funktionsweise

(:source lang=php linenum:)
<? foreach ($items as $item) : ?>
  <tr class="<?= TextHelper::cycle('odd', 'even') ?>">
     <td><?= item ?></td>
  </tr>
<? endforeach ?>
 
 
March 16, 2010, at 03:05 PM by mriehe -
Added lines 1-9:

TextHelper

Diese Klasse der FlexiTemplates bieten einige nützliche Funktionen, die oft benötigte aufgaben in Templates erledigen.

camelize($word)

cycle(array('a', 'b'))

 

 

Source: Basis-Wiki-Hilfe | Last change: April 01, 2011, at 11:42 PM, tthelen | Local view: Basis-Hilfe