는 :
https://docs.typo3.org/typo3cms/ExtbaseFluidBook/8-Fluid/9-using-php-based-views.html
I 출력에 액션 JSON을 만들어보십시오.TYPO3 확장 PHP보기
public function listAction()
{
$storelocators = $this->storelocatorRepository->findAll();
$this->view->assign('storelocators', $storelocators);
}
그리고 ext/my_storelocator/Classes/View/Storelocator
에 내가 가진 클래스 List.php
:
<?
class Tx_MyStorelocator_View_Storelocator_List extends Tx_Extbase_MVC_View_AbstractView {
public function render() {
return 'Hello World';
}
}
내가 할 모든이 : 그래서
Sorry, the requested view was not found.
The technical reason is: No template was found. View could not be resolved for action "list" in class "My\MyStorelocator\Controller\StorelocatorController".
나는 list 액션을 사용하여 일반 컨트롤러가 경로에 문제가 있다고 생각합니다. 또는 문제는 어디에 있습니까?
편집 : Extensioninfos
업체 : 내
키 my_storelocator
컨트롤러 : 모르겠 음 (필자는 extension_builder 함께 만든 그래서 난 내 컨트롤러 이름은 매장 검색 추측)
조치 : 목록
내 이해에서 Tx_MyStorelocator_View_Storelocator_List
과 같은 클래스 이름이 정확해야합니다. 하지만 작동하지 않습니다.
날짜가 맞지 않아 이것이 내 문제입니다. 다른 부분에는'listAction()'이있는 컨트롤러가 있습니다. 거기에 json을 출력하고 pageType을'disableAllHeaderCode'와 함께 사용할 수 있습니다. 그러나 템플리트가없는 경우 여전히 템플리트 및 가능한 html 주석/또는 오류를로드합니다. 어떻게 든 템플릿 (및 렌더링)을 비활성화 할 수 있습니까? – nbar
listAction에 return 문을 추가하십시오. 여기 JSON 객체를 문자열로 반환 할 수 있습니다. TYPO3는 액션의 반환 데이터 유형을 평가하고 무효 인 경우 뷰를 렌더링하려고합니다. 그래서 그냥 빈 문자열을 반환하고 List.html 템플릿이 없기 때문에이 오류를 생성하는 view-> render 메서드는 호출되지 않습니다.) – Lasse
여기에는 문제가 없습니다. 액션이 존재하지 않거나 실행되지 않으면 @nbar는이 오류 지점에 도달하지 않습니다. – j4k3