0

运行此查询时...列表视图中的链接中没有显示操作...并且它们不再起作用:

控制器.php

$uid = 10;
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
$statement = $queryBuilder  
    ->select('uid', 'pid', 'header')            
    ->from('tt_content')
    ->where(
       $queryBuilder->expr()->eq('uid', $uid)
    )           
    ->execute();    
while ($row = $statement->fetchAll()) {
    $this->view->assign('inet', $row);
}

安慰:

<tr id="2">
    <td>2</td>
    <td class="name"><a href="code/?tx_code_code%5Brecord%5D%5Buid%5D=2&amp;tx_code_code%5Brecord%5D%5Bcode%5D=25490004X&amp;tx_code_code%5Brecord%5D%5Bname%5D=Company%20Name%20Inc&amp;cHash=e8e3573028618746234">Company Name Inc</a></td>
</tr>

当我调试它时,我可以看到我渲染了以下数组:

array(20 items)
   0 => array(3 items)
      uid => 1 (integer)
      code => '213800' (6 chars)
      name => 'Company Name Inc' (16 chars)

我怎样才能让链接再次工作?

4

1 回答 1

1

改变

<f:link.action action="show" pageUid="43" arguments="{record:record}">{record.name}</f:link.action>

<f:link.action action="show" pageUid="43" arguments="{record:record.uid}">{record.name}</f:link.action>

因为您不再获取对象,而是获取数据库行的数组。此外,您的 listAction 缺少参数 $minUid 和 $maxUid。

于 2017-08-24T17:34:23.810 回答