SHARE
TWEET

Untitled

a guest Sep 13th, 2017 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. require 'core/CoreEvent/CoreEvent.php';
  4. require 'core/CoreData/CoreData.php';
  5.  
  6. ?>
  7. <!doctype html>
  8. <html>
  9. <head>
  10. <title></title>
  11. </head>
  12. <body>
  13.    
  14. <?php $form = new Core\CoreData\Form(array('model' => 'Client', 'id' => 'UpdateClientForm'), function($f) { ?>
  15.     <p>
  16.         <label>
  17.             Name:
  18.             <?php $f->input(array('name' => 'name', 'type' => 'text')); ?>
  19.         </label>
  20.     </p>
  21.     <p>
  22.         <?php $f->submit(); ?>
  23.     </p>
  24. <?php }); ?>
  25.  
  26. </body>
  27. </html>
  28.  
  29. <?php
  30. $form->addEventListener(Core\CoreData\Form::EVENT_SUBMIT, function($data) {
  31.     echo '<div class="success">Form submitted.</div>';
  32.     print_r($data);
  33. });
  34. ?>
RAW Paste Data
Top