Changeset 1472

Show
Ignore:
Timestamp:
12/09/2007 12:01:31 AM (13 months ago)
Author:
Shadowhand
Message:

Added forge_demo/edit_user/$id and User_Edit_Model to demonstrate how to extend ORM with Forge.

Location:
trunk
Files:
2 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/forge/controllers/forge_demo.php

    r1465 r1472  
    3030                $form->submit('Save'); 
    3131 
     32                echo Kohana::debug(headers_list());exit; 
     33 
    3234                if ($form->validate()) 
    3335                { 
     
    3638 
    3739                echo $form->html(); 
     40        } 
     41 
     42        public function edit_user($id = FALSE) 
     43        { 
     44                $profiler = new Profiler; 
     45 
     46                $form = new User_Edit_Model(NULL, 'Edit User', $id); 
     47 
     48                if ($form->save()) 
     49                { 
     50                        echo Kohana::debug('user edited!', $form->as_array()); 
     51                } 
     52                else 
     53                { 
     54                        echo $form; 
     55                } 
    3856        } 
    3957 
  • trunk/modules/forge/libraries/Form_Dateselect.php

    r1465 r1472  
    7979                        else 
    8080                        { 
    81                                 // Minute(s), Hour(s), etc 
     81                                // minute(s), hour(s), etc 
    8282                                $type .= 's'; 
    8383 
  • trunk/system/libraries/Naked_Woman.php

    r1460 r1472  
    1717                ( 
    1818                        'cash::generate(), plz?',  
    19                         'There are no naked women or cash generators in Kohana. Sorry.' 
     19                        'There are no naked women or cash generators in Kohana. Sorry! ;)' 
    2020                ); 
    2121        } 
  • trunk/system/libraries/ORM.php

    r1437 r1472  
    6666 
    6767                // Fetch table name 
    68                 $this->class = strtolower(substr(get_class($this), 0, -6)); 
    69                 $this->table = inflector::plural($this->class); 
     68                empty($this->class) and $this->class = strtolower(substr(get_class($this), 0, -6)); 
     69                empty($this->table) and $this->table = inflector::plural($this->class); 
    7070 
    7171                if (empty(self::$fields[$this->table]))