Cytat(ddiceman @ 13.01.2010, 14:47:24 )

no ale jak juz cos, to (za skarby nie moge wymyslec, po co

) rozwiazaniem dla Ciebie sa tzw. "zmienne zmienne"
już piszę po co

, mam taką metodę
/**
*
* @param array $post
* @param array $conditions
* @return boolean
*/
public function check
( $post, array $conditions ) {
$this->post = $post;
$this->conditions = new Validation( $this->post );
$this->conditions->pre_filter( 'trim' );
foreach( $conditions as $k => $v )
{
$this->conditions->add_rules( $k, $v );
}
return $this->conditions->validate();
}
i wywołuje ją w następujący sposób
Parse_Data
::instance()->check( $_POST, array( 'queue' => array( 'required', 'numeric' ), 'spots' => 'required',
'score' => 'required',
'lost_spots' => 'required',
'name' => 'required' ) )
w tym momencie jest błąd, gdyż zamiast postaci:
add_rules( queue, required, numeric );
jest
add_rules
( queue
, array( required
, numeric
) );