[eluser]johnmerlino[/eluser]
Hey all,
Code:
//autoload.php
$autoload['libraries'] = array('enumerator');
//libraries/enumerator.php
<?php
class Enumerator {
public $arr;
public function __construct($array) {
$this->arr = $array;
}
public function each($lambda) {
array_walk($this->arr, $lambda);
}
//views/partials/_contact.php
$elements = new Enumerator(array('email','fax','phone','postal mail'));
echo $elements->each(function($l){ form_checkbox("checked[]",$l) });
It throws this error:
Code:
Missing argument 1 for Enumerator::__construct(), called in system/libraries/Loader.php on line 928 and defined
thanks for response