コード例 #1
0
ファイル: utilities.php プロジェクト: biggtfish/magixcms
 /**
  * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. 
  * Arrays and array-like objects with a length property (such as a function's arguments object) 
  * are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
  *
  * @param void $object
  * @param void $callback
  * @return string
  */
 public static function jEach($object, $callback)
 {
     $each = magixcjquery_jquery_magixcjQuery::getjQueryHandling() . '.each(';
     $each .= $object ? '[' . parent::forSimpleValue($object) . ']' : false;
     $each .= $callback ? ',' . $callback : false;
     $each .= ');';
     return $each;
 }
コード例 #2
0
ファイル: fireunit.php プロジェクト: biggtfish/magixcms
 /**
  * run multiple pages of tests:
  *
  * @param array() $tpages
  * @return string
  */
 public static function runTests($tpages)
 {
     return 'fireunit.runTests(' . parent::forSimpleValue($tpages) . ');';
 }