コード例 #1
0
    public static function getForm( $args ) {
        if( count($args) != 1 ) return false;
        if( $args[0] == null ){

            $item = ModelHandler::getEmptyItem("Users");
            //l($item);
        }else{
            $item = ModelHandler::get("Users", $args);
            $item = $item[0];
        }
        $form = ViewHandler::wrap("Form", $item);
        return $form;
    }
コード例 #2
0
ファイル: Posts.model.php プロジェクト: neronmoon/Veronica
 public static function save($args) {
     
     if( count($args) != 3 ) return false;
     
     if( $args[2] ){
         $item = array(ModelHandler::getEmptyItem("Posts"));
         
     }else{
         $item = ModelHandler::get("Posts", array($args[0]));
     }
     foreach ($args[1] as $key => $value) {
         $item[0]->bean[$key] = $value;
     }
     
     return ModelHandler::save($item[0]);
     
 }