Skip to content

Instantly share code, notes, and snippets.

@marcincodes
Created November 28, 2013 13:26
Show Gist options
  • Save marcincodes/7691811 to your computer and use it in GitHub Desktop.
Save marcincodes/7691811 to your computer and use it in GitHub Desktop.
//add ctp
<div class="add topic form">
<?php echo $this->Form->create('Theard'); ?>
<fieldset>
<legend><?php echo __('Add Topic'); ?></legend>
<?php
echo $this->Form->input('name');
echo $this->Form->input('Post.body');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit')); ?>
</div>
//add class theard controller
public function add() {
if ($this->request->is('post')) {
$this->Theard->create();
$this->Theard->saveAssociated($this->request->data, array('deep' => true));
debug($this->request->data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment