Skip to content

Instantly share code, notes, and snippets.

Created August 25, 2016 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/202a4503e603cc0d2192d37f8bcd7cd1 to your computer and use it in GitHub Desktop.
Save anonymous/202a4503e603cc0d2192d37f8bcd7cd1 to your computer and use it in GitHub Desktop.
<?= $this->Form->create($contatcs) ?>
<fieldset>
<div class='input-list style-2 clearfix'>
<?php
echo $this->Form->input(('nome'), array('class' => 'form-control'));
echo $this->Form->input(('Email'),array('class' => 'form-control','empty' => 'entrada' ));
echo $this->Form->input(('mensagem'),array('type' => 'textarea','class' => 'form-control','empty' => 'entrada2' ));
?>
</div>
</fieldset>
<br/>
<?= $this->Form->button(__('Enviar Mensagem'),
array('class' => 'btn btn-primary button-marques', 'title' => 'Enviar Mensagem')) ?>
<?= $this->Form->end() ?>
<?php
class ContactsCell extends Cell
{
protected $_validCellOptions = [];
public function display()
{
<?= $this->cell('Contact::add') ?>
}
}
<? = $cell = $this->cell('Contatcts'); ?>
@cwbit
Copy link

cwbit commented Aug 25, 2016

you've misspelled contacts in both your home.ctp and add.ctp (form->create) and your Cell display method should act exactly like a Controller action, so ..

<?php
class ContactsCell extends Cell
{
    protected $_validCellOptions = [];
    public function display()
    {
        $contact = $this->Contacts->newEntity();
        $this->set(compact('contact'));
    }
}

@cwbit
Copy link

cwbit commented Aug 25, 2016

   <?= $this->Form->create($contact, ['controller'=>'Users', 'action'=>'add']) ?>
       <fieldset>  
      <div class='input-list style-2 clearfix'>   
        <?php
            echo $this->Form->input(('nome'), array('class' => 'form-control'));
            echo $this->Form->input(('Email'),array('class' => 'form-control','empty' => 'entrada' ));
            echo $this->Form->input(('mensagem'),array('type' => 'textarea','class' => 'form-control','empty' => 'entrada2' ));
        ?>  
           </div>
    </fieldset>
    <br/>
    <?= $this->Form->button(__('Enviar Mensagem'), 
    array('class' => 'btn btn-primary button-marques', 'title' => 'Enviar Mensagem')) ?>
    <?= $this->Form->end() ?>

@cwbit
Copy link

cwbit commented Aug 25, 2016

<?= $cell = $this->cell('Contacts'); ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment