○View
1.
<?= $this->Form->create(null, array('url' => array('controller' => 'users', 'action' => 'name'))); ?> <input type="hidden" name="user_name" value="user1" /> <input type="submit" value="Post" /> <?= $this->Form->end(); ?>
2.
<?php echo $this->Form->create(null, array('url' => array('controller' => 'Myscraper', 'action' => 'index')));?>
<?=$this->Form->input('url', ['type' => 'textarea','label' => 'Scraper Box','style'=>'font-size : 13px;margin-right:10px;height: 250px;','id'=>'scrapertext','value'=>'test']);?>
<?php echo $this->Form->submit('Capture!',array('class' => 'btn-success','style'=>'font-size : 14px; text-align : center')); ?>
<?php echo $this->Form->end(); ?>
○Conrtroller
1.
public function name() {
if (!empty($this->request->data)) {
//$name変数には「user1」が格納される
$name = $this->request->data('user_name');
// 以下保存ロジック
}
}
2.
$scrapeurl = $this->request->getData('url');