Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo $this->Form->create("POST", ['url' => '/articles/lead']);
- echo $this->Form->input('Nome');
- echo $this->Form->input('Email');
- echo $this->Form->button(__('Salvar'));
- echo $this->Form->end();
- ?>
- public function lead(){
- $lead = $this->Lead->newEntity();
- print_r($lead);
- $leads = $this->Lead->newEntity();
- if ($this->request->is('post')) {
- $article = $this->Lead->patchEntity($leads, $this->request->getData());
- if ($this->Lead->save($leads)) {
- $this->Flash->success(__('Seu artigo foi salvo.'));
- return $this->redirect(['action' => 'index']);
- }
- $this->Flash->error(__('Não é possível adicionar o seu artigo.'));
- }
- $this->set('Leads', $leads);
- }
- <?php
- // src/Model/Table/LeadTable.php
- namespace AppModelTable;
- use CakeORMTable;
- class LeadTable extends Table
- {
- public function initialize(array $config)
- {
- $this->addBehavior('Timestamp');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement