HosipLan

Untitled

Mar 30th, 2011
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. protected function createComponentAddUserForm($name)
  2. {
  3.     $form = new AppForm($this, $name);
  4.     $form->...
  5.  
  6.     $defaults = $this->model->find($this->id);
  7.     $form->setDefaults($defaults);
  8.  
  9.     // ...
  10. }
  11.  
  12. public function AddUserFormSubmit($form)
  13. {
  14.     if (!$user->inRole('admin')) {
  15.         throw new BadRequestException();
  16.     }
  17.  
  18.     // ...
  19. }
  20.  
  21.  
  22. // ...
  23.  
  24. {if $user->inRole('admin')}
  25.     {control addUserForm}
  26. {/if}
Advertisement
Add Comment
Please, Sign In to add comment