无法解析验证程序的类名

时间:2015-08-03 22:31:40

标签: php typo3 typo3-6.2.x

在将我的typo3系统从4.5版更新到6.2后,我遇到了一些问题。 如果我尝试打开操作链接,我会收到一条错误消息。

Invalid validate annotation in Tx_UserAguGb_Controller_RiskAssessmentController->deleteAction(): 
Could not resolve class name for validator "Tx_UserAguGb_Domain_Validator_AssessmentAccess".

项目结构:

  • user_agu_gb
      • 控制器
        • RiskAssessmentController.php
        • 模型
          • HazardAcessment.php
        • 存储库
          • HazardAssessmentRepository.php
        • 验证
          • AssessmentAcess.php

以下是一些代码段。

RiskAssessmentController.php

class Tx_UserAguGb_Controller_RiskAssessmentController extends Tx_UserAguGb_Controller_ExtendedController {

/**
 * @param Tx_UserAguGb_Domain_Model_HazardAssessment|null $assessment
 * @validate $assessment Tx_UserAguGb_Domain_Validator_AssessmentAccess
 * @return void
 */
public function deleteAction(Tx_UserAguGb_Domain_Model_HazardAssessment $assessment = NULL) {
    $this->hazardAssessmentRepository->remove($assessment);
    $this->redirect('list');
}
?>

AssessmentAcess.php

<?php    
class Tx_UserAguGb_Domain_Validator_AssessmentAccess extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator {
    public function isValid($value)
    {
         someCode()...
    }
}
?>

List.html

<f:link.action action="delete"
    class="assessment-button"
    controller="RiskAssessment"
    additionalAttributes="{data-confirm:alert-delete_assessment}"
    arguments="{assessment: assessment}">
    <f:translate key="button-delete"/>
</f:link.action>

0 个答案:

没有答案