我的ctp文件代码:
<?php echo $this->Form->create('Users',array('action'=>'port_settings_edit')); ?>
<tr><td><center><?php echo $this->Form->input('process',array('type'=>'hidden','value'=>$pid,'id'=>'pid')); ?>
<?php echo $pname; ?></center></td><td><center>
<?php echo $characteristic; ?></center></td><td><center>
<select id="deviceid"></select></center></td><td><center><select id="instid">
<option value="">Select Any</option>
<option value="xyzz">xyzz</option>
<option value="fgh">fgh</option>
<option value="abc">abc</option>
</select></center></tr></table>
<BR><BR>
<button type="submit" id="submit_btn" class="bott1"><font size=3 ><b>SUBMIT</b></font></button>
在我的控制器中定义的功能:
function port_settings_edit($id=null)
{
$this->loadModel('Process');
$op=$this->Process->find('first',array('conditions'=>array('Process.id'=>$id)));
$this->set('pname',$op['Process']['name']);//ERROR
$this->set('pid',$op['Process']['id']);//ERROR
$this->set('characteristic',$op['Process']['characteristic']);//ERROR
if(!empty($this->data))
{
//$this->layout = false;
//print_r($this->data);
$this->Session->setFlash('PORTS SETTINGS ARE DONE SUCCESSFULLY.');
$this->redirect(array('action'=>'viewport'));
}
}
我在这3行遇到同样的错误。即
未定义语法:进程
我已经定义了变量。
答案 0 :(得分:0)
我可以在CakePHP代码中看到一些问题。
<?php echo $this->Form->create('Users',array('url'=>['action'=>'port_settings_edit',$pid]));?>
另请注意您正面临的错误。