Source for file Trim.php

Documentation is available at Trim.php

  1. <?php
  2. /**
  3.  * Teeple2 - PHP5 Web Application Framework inspired by Seasar2
  4.  *
  5.  * PHP versions 5
  6.  *
  7.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  8.  * that is available through the world-wide-web at the following URI:
  9.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  10.  * the PHP License and are unable to obtain it through the web, please
  11.  * send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @package     teeple
  14.  * @author      Mitsutaka Sato <miztaka@gmail.com>
  15.  * @license     http://www.php.net/license/3_0.txt  PHP License 3.0
  16.  */
  17.  
  18. /**
  19.  * 前後の空白を除去します。
  20.  * 対象となるプロパティが配列の場合は各値に対してtrimを実行します。
  21.  *
  22.  * @package teeple.converter
  23.  */
  24. {
  25.     
  26.     protected function execute(&$obj$fieldName{
  27.         
  28.         $value Teeple_Util::getProperty($obj$fieldName);
  29.         if (is_array($value)) {
  30.             array_walk($value'trim');
  31.         else {
  32.             $value trim($value);
  33.         }
  34.         Teeple_Util::setProperty($obj$fieldName$value);
  35.         return TRUE;
  36.     }
  37.     
  38. }
  39. ?>

Documentation generated on Mon, 26 Apr 2010 09:00:02 +0900 by phpDocumentor 1.4.3