Source for file default.php

Documentation is available at default.php

  1. <?php
  2.  
  3. /**
  4.  * Returns a variable or a default value if it's empty
  5.  * <pre>
  6.  *  * value : the variable to check
  7.  *  * default : fallback value if the first one is empty
  8.  * </pre>
  9.  * This software is provided 'as-is', without any express or implied warranty.
  10.  * In no event will the authors be held liable for any damages arising from the use of this software.
  11.  *
  12.  * @author     Jordi Boggiano <j.boggiano@seld.be>
  13.  * @copyright  Copyright (c) 2008, Jordi Boggiano
  14.  * @license    http://dwoo.org/LICENSE   Modified BSD License
  15.  * @link       http://dwoo.org/
  16.  * @version    1.0.0
  17.  * @date       2008-10-23
  18.  * @package    Dwoo
  19.  */
  20. function Dwoo_Plugin_default_compile(Dwoo_Compiler $compiler$value$default='')
  21. {
  22.     return '(($tmp = '.$value.')===null||$tmp===\'\' ? '.$default.' : $tmp)';
  23. }

Documentation generated on Sat, 18 Jul 2009 21:04:50 +0200 by phpDocumentor 1.4.0