Advertisement
Guest User

codes

a guest
Nov 14th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.32 KB | None | 0 0
  1. Controller
  2. ------------------------
  3. public function action_contact(){
  4. //             if(Input::post('send')){
  5.                 $email = \Email::forge();
  6.                 $email->from('catchall@xxx.com', 'My Name');
  7.                 $email->to('catchall@xxx.com', 'Johny Squid');
  8.                 $email->subject('This is the subject');
  9.                 $email->body('This is my message');
  10.  
  11.                 $email->send();
  12.  
  13. //                 Response::redirect('web/index');
  14.                 Session::set_flash('success', 'Contacto Enviado');
  15. //             }
  16.  
  17.  
  18.         $data = array();
  19.         $this->template->title = 'No dudes en escribirnos';
  20.         $this->template->content = View::forge('web/contact', $data);
  21.         }
  22. ------------------------------------------------------------------------------------------------------------------------
  23. View
  24. ------------------------
  25. <?php echo Form::open('/web/contact'); ?>
  26.             <?php echo Form::fieldset_open(
  27.                                         array(
  28.                                             'class' => 'uk-form',
  29.                                             'style'=>'border: 0;',
  30.                                             'data-uk-margin'=>'')); ?>
  31. <div class="">
  32.             <?php echo Form::input('name',
  33.                                    Input::post('name'),
  34.                                    array(
  35.                                        'type' => 'text',
  36.                                        'class'=> 'uk-width-1-1',
  37.                                        'placeholder'=>'Cuentanos como te llamas')); ?>
  38. </div>
  39. <div class="">
  40.             <?php echo Form::input('telefono',
  41.                                    Input::post('telefono'),
  42.                                    array(
  43.                                        'type' => 'text',
  44.                                        'class'=> 'uk-width-1-1',
  45.                                        'placeholder'=>'Nos quieres dejar tu telefono para que te llamemos')); ?>
  46. </div>
  47. <div class="">
  48.             <?php echo Form::input('email',
  49.                                    Input::post('email'),
  50.                                    array(
  51.                                        'type' => 'text',
  52.                                        'class'=> 'uk-width-1-1',
  53.                                        'placeholder'=>'Quieres que te enviemos la informacion a una casilla de mail')); ?>
  54. </div>
  55. <div class="">
  56.             <?php echo Form::textarea('main',
  57.                                       Input::post('main'),
  58.                                       array(
  59.                                           'type' => 'textarea',
  60.                                           'style'=> 'height: 250px',
  61.                                           'class'=> 'uk-width-1-1',
  62.                                           'placeholder'=>'Que informacion o datos estarías necesitando que te brindemos')); ?>
  63. </div>
  64.             <?php echo Form::submit('send', 'Enviar',
  65.                                     array(
  66.                                         'type' => 'button',
  67.                                         'class' => 'uk-button uk-button-primary uk-button-large',
  68.                                         'style' => 'float:right; color: #F5F7F9'));  ?>
  69.             <?php echo Form::fieldset_close(); ?>
  70.             <?php echo Form::close(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement