1
Class FramingPartnersController extends CroogoAppController {
public $components = array('Paginator', 'Session');
public $uses = array('FramingPartner');
public function index() {
$test = 'This is Framing Partners Index';
$this->set(compact('test'));
}
public function profile() {
if(!empty($this->request->data)){
if ($this->request->is('post')) {
$this->FramingPartner->create();
if ($this->FramingPartner->save($this->request->data)) {
$this->Session->setFlash(__d('croogo', 'The profile has been saved'), 'flash', array('class' => 'success'));
$this->redirect(array('action' => 'frames'));
} else {
$this->Session->setFlash(__d('croogo', 'The profile could not be saved. Please, try again.'), 'default', array('class' => 'error'));
}
}
}
}
public function frames() {
$test = 'This is Framing Partners frames';
$this->set(compact('test'));
}
}如何發送兩個不同的數據到兩個不同的表中,從cakephp中同一個控制器中的兩個不同的動作?
我有每兩個的輪廓和框架不同的表,並希望將數據從上述動作傳送給各自的表。 簡而言之,來自配置文件的數據應該發送到配置文件表,並且來自幀的數據應該發送到幀表。
Profile和Frame模型和FramingPartner模型之間是否存在關聯? –