FluidTYPO3\Fluidpages\Provider\PageProvider::getTemplatePathAndFilename PHP Method

getTemplatePathAndFilename() public method

public getTemplatePathAndFilename ( array $row ) : string
$row array
return string
    public function getTemplatePathAndFilename(array $row)
    {
        $templatePathAndFilename = $this->templatePathAndFilename;
        $action = $this->getControllerActionReferenceFromRecord($row);
        if (false === empty($action)) {
            $paths = $this->getTemplatePaths($row);
            $templatePaths = new TemplatePaths($paths);
            list(, $action) = explode('->', $action);
            $action = ucfirst($action);
            $templatePathAndFilename = $templatePaths->resolveTemplateFileForControllerAndActionAndFormat('Page', $action);
        }
        return $templatePathAndFilename;
    }

Usage Example

 public function testGetTemplatePathAndFilename()
 {
     $expected = ExtensionManagementUtility::extPath('fluidpages', 'Tests/Fixtures/Templates/Page/Dummy.html');
     $fieldName = 'tx_fed_page_controller_action';
     $dataFieldName = 'tx_fed_page_flexform';
     $service = $this->getMock('FluidTYPO3\\Fluidpages\\Service\\PageService', array('getPageTemplateConfiguration'));
     $instance = new PageProvider();
     $instance->setTemplatePaths(array('templateRootPath' => 'EXT:fluidpages/Tests/Fixtures/Templates/'));
     $instance->injectPageService($service);
     $record = array($fieldName => 'Fluidpages->dummy');
     $service->expects($this->any())->method('getPageTemplateConfiguration')->willReturn($record);
     $instance->trigger($record, NULL, $dataFieldName);
     $result = $instance->getTemplatePathAndFilename($record);
     $this->assertEquals($expected, $result);
 }