Typo3 - extbase - 缺少类型信息,可能没有@param注释参数" $ currentPage"

时间:2015-03-12 10:23:54

标签: annotations typo3 extbase typo3-6.2.x

我在Typo3 Backend中收到以下错误:

Missing type information, probably no @param annotation for parameter "$currentPage" in Tx_OptivoBm_Controller_NewsletterController->newAction()

该功能设置如下:

/**
 * action new
 *
 * @param $currentPage
 * @param $newNewsletter
 * @dontvalidate $newNewsletter
 * @return void
 */
public function newAction($currentPage) {
    if (!isset($currentPage)){
        $this->redirect('index');
    }
}

我也尝试过:

/**
 * action new
 *
 * @param array $currentPage
 * @param $newNewsletter
 * @dontvalidate $newNewsletter
 * @return void
 */
public function newAction(array $currentPage) {
    if (!isset($currentPage)){
        $this->redirect('index');
    }
}

但这没有什么区别。

有谁知道出了什么问题?

- 感谢@Fixus -

/**
 * action new
 *
 * @param array $currentPage
 * @return void
 */
public function newAction($currentPage) {
    if (!isset($currentPage)){
        $this->redirect('index');
    }
}

现在正在运作。

1 个答案:

答案 0 :(得分:1)

当你声明param时,你需要设置它的类型。对于他们所有人不仅一个。 如果您不确定要设置的类型,请使用“混合”

如果未在方法中声明@param $newNewsletter,为什么会这样?删除此注释或将其添加到定义

不要在方法声明中设置array $currentPage。简单类型可以提供一些php错误

在所有更改之后转到typo3temp并手动清除它(不是来自BE)。像这样的错误可以存储在那里,而不是从BE

中正确清除