cakephp中的两个提交按钮,用于将内容保存在两个不同的表中

时间:2015-05-04 07:54:09

标签: cakephp

我有一个日程按钮和一个发送按钮。发送按钮直接发送文本(即)它将数据保存在表twilio_sent_text中。我在这里尝试的是,当我单击日程表按钮时,数据应该保存在另一个表中。这是我的视图代码:

<?php
echo $this->Form->create('TwilioText', array(
    'url' => array('controller' => 'Emailer','action' => 'text_sendmsg'), 
    'novalidate'
));
echo $this->Form->input('TwilioSentText.msgSentNmbr', array(
    'type' => 'hidden', 
    'placeholder' => 'Phone', 
    'label' => false, 
    'class' => 'form-control', 
    'div' => false, 'value' => $value
));
echo $this->Form->input('TwilioSentText.msgTitle', array(
    'label' => false, 
    'class' => 'text-list', 
    'div' => false,
    'type' => 'select',                  
    'ng-options' => "key as value.textName for (key , value) in textcontents",
    'ng-change' => "textcontent = textcontents[textName].textDescription;",
    'ng-model' => "textName",'empty' => 'Content'
));
echo $this->Form->input('', array(
    'label' => false, 
    'class' => 'text-list3', 
    'div' => false,
    'type' => 'select',
    'ng-options' => "",
    'ng-change' => "",
    'ng-model' => "",
    'empty' => 'Current Deals'
));
echo $this->Form->textarea('TwilioSentText.sent_msg', array(
    'placeholder' => 'Text Content', 
    'ng-model' => 'textcontent', 
    'label' => false, 
    'id' => 'nwtext', 
    'class' => 'form-control', 
    'div' => false, 
    'value' => ''
)); 
echo $this->Form->submit('Schedule', array(
    'div'=>false, 
    'name'=>'submit',
    'url'=> array('controller'=>'Emailer','action'=>'auto_text')
)); 
echo $this->Form->submit('Send', array(
    'class' => 'btntext', 
    'div' => false
));
echo $this->Form->end(); 
?>

发送按钮工作正常但是当我点击日程安排按钮时,它正在执行与发送按钮相同的操作。

0 个答案:

没有答案