Advertisement
Guest User

Untitled

a guest
Oct 8th, 2017
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1.  
  2. From Controller :
  3.  
  4.  
  5.  
  6. # Save User
  7. my $user = {
  8. login => $login,
  9. password => $password,
  10. email => $email
  11. };
  12.  
  13. print Dumper $user;
  14.  
  15. my $user_id = ChannelStore::Model::User->insert($user);
  16.  
  17.  
  18. In Model:
  19.  
  20. sub insert
  21. {
  22. my $ref = shift;
  23. my $db = ChannelStore::Model->db;
  24. my $users = $db->users;
  25. print Dumper $ref;
  26. $users->insert($ref);
  27. }
  28.  
  29. Output from the dumpers in the two different files
  30.  
  31. $VAR1 = {
  32. 'email' => 'bryanpaluch@gmail.com',
  33. 'password' => 'newmedia',
  34. 'login' => 'bryanpaluch'
  35. };
  36.  
  37.  
  38.  
  39. $VAR1 = 'ChannelStore::Model::User';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement