안녕하세요. cakephp 페이지가 있습니다. 링크를 가리키면 올바른 링크가 표시되지만 링크를 클릭하면 완전히 다른/잘못된 페이지로 연결됩니다.CakePhP Linking
나는 그것의 내보기에 오류 가정, 그래서 무슨 일이 일어나고 있는지 여기 사이트의 관련 부분을 포함 할 것이다는 add link
가 link
기능 fields/add_new
<tr>
<td align='center'><?php echo $templates['Template']['name'] ;?></td>
<td align='center'><?php echo $templates['Template']['description']; ?> </td>
<td align='center'>
<?php echo $this->Form->Html->link('Add', array('controller' => 'Fields','action'=>'add_new',$templates['Template']['id'])); ;?> |
<?php echo $this->Form->Html->link('View', array('controller' => 'Fields','action'=>'view',$templates['Template']['id'])); ;?> |
<?php echo $this->Form->Html->link('Edit', array('controller' => 'Templates','action'=>'edit',$templates['Template']['id'])); ;?> |
<?php echo $this->Form->Html->link('Delete', array('controller' => 'Templates','action'=>'delete',$templates['Template']['id'])); ;?></td>
<tr>
function add_new($id=null){
//allows users to add another field to an existing template
$this->set('title_for_layout', 'Create Fields');
$this->set('stylesheet_used', 'homestyle');
$this->set('image_used', 'eBOXLogoHome.png');
$this->layout='home_layout';
if(($this->Field->save($this->request->data)))
{
$id = $this->data['Field']['template_id'];
$this->set('id',$id);
$this->redirect(array('controller'=>'Fields', 'action'=>'view',$id));
}
$this->set('id',$id);
}
: 컨트롤러 코드를 여기에 공유하십시오 – chetanspeed511987
페이지가 자동으로 리디렉션된다는 것을 깨달았습니다. 컨트롤러 코드를 지금 업데이트하겠습니다. – user1393064