0

次のアクションがあります。

    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>

4

2 に答える 2

1
$websites['Website']['website_id']

そしてそうではない

$website['Website']['website_id']

(単数ではなく複数)

編集:コード全体を見た後

$site['Website']['website_id']
于 2013-10-04T08:48:28.373 に答える
1

あなたの$this->Html->link設定'action' => 'website_status' では、それは admin_website_status であるはずですか?

また$website['Website']['website_id']、値があることを確認してください。多分それは空です。

于 2013-10-04T08:49:08.080 に答える