Advertisement
Guest User

Untitled

a guest
May 27th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2. class Doctrine_Tools extends Controller {
  3.  
  4.     function create_tables() {
  5.  
  6.         echo 'Reminder: Make sure the tables do not exist already.<br />
  7.         <form action="" method="POST">
  8.         <input type="submit" name="action" value="Create Tables"><br /><br />';
  9.  
  10.         if ($this->input->post('action')) {
  11.             Doctrine::createTablesFromModels();
  12.             echo "Done!";
  13.         }
  14.     }
  15.     function test() {
  16.         $u = new User();
  17.         $data = array(
  18.                 'username' => 'testuser',
  19.                 'firstName' => 'Test',
  20.                 'lastName' => 'User',
  21.                 'email' => 'test@test.com',
  22.                 'password' => 'a327310'
  23.         );
  24.         $u->fromArray($data);
  25.        
  26.         $u->save();
  27.         echo 'User Created';
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement