我有以下作用:CakePHP的價值心不是發送到動作
public function admin_website_status($id = null){
$i = 0;
$this->Paginator->settings = array(
'Website' => array(
)
);
$this->set('websites',$this->Paginator->paginate('Website'));
}
現在我想的值發送到這個動作所以在我看來,我有以下鏈接:
<?php echo $this->Html->link(__('Active'), array('action' => 'website_status', $website['Website']['website_id'])); ?>
當我調試這個沒有值發送,即使我知道值應該是1
那麼我做錯了什麼?
我衆目睽睽
<div class="portlet box red">
<div class="portlet-title">
<div class="caption"><i class="icon-globe"></i>Website Status</div>
</div>
<div class="portlet-body">
<table class="table table-striped table-bordered table-hover table-full-width" id="sample_1">
<thead>
<tr>
<th><?php echo $this->Paginator->sort('Website.domain', 'Website domain');?></th>
<th><?php echo $this->Paginator->sort('Website.client_id', 'Affiliate ID');?></th>
<th><?php echo $this->Paginator->sort('User.username', 'E-mail Address');?></th>
<th><?php echo $this->Paginator->sort('Status.status', 'Status'); ?> </th>
<th class="actions"><?php echo __('Actions'); ?></th>
</tr>
</thead>
<?php foreach ($websites as $site): ?>
<tr>
<td><?php echo $site['Website']['domain']; ?></td>
<td><?php echo $site['Client']['client_id'];?></td>
<td><?php echo $site['Client']['user_id'];?></td>
<td><?php echo $site['Status']['Status']; ?></td>
<td class="actions">
<?php echo $this->Html->link(__('Active'), array('action' => 'website_status', $website['Website']['website_id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="paging">
<?php
echo $this->Paginator->prev('« Previous', null, null, array('class' => 'disabled'));
echo $this->Paginator->next('Next »', null, null, array('class' => 'disabled'));
?>
</div>
</div>
這不是問題,我會發布我的全視圖在這裏,所以你可以看到..該鏈接正在生成一個循環 – Marc
SOOO失敗我剛剛意識到問題是,它不是$網站它的$網站!你是對的! – Marc
so:'$ site ['Website'] ['website_id']'。 – arilia