TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
CategoriesViewHelper Class Reference
Inheritance diagram for CategoriesViewHelper:
AbstractMenuViewHelper AbstractViewHelper

Public Member Functions

 initializeArguments ()
 
 render ()
 
- Public Member Functions inherited from AbstractViewHelper
 setRenderingContext (\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 prepareArguments ()
 

Protected Member Functions

 findByCategories ($categoryUids, $relationField, $tableName= 'pages')
 
- Protected Member Functions inherited from AbstractMenuViewHelper
 getPageConstraints ($includeNotInMenu=false, $includeMenuSeparator=false)
 
 getPageUids (array $pageUids, $entryLevel=0)
 
 renderChildrenWithVariables (array $variables)
 
 getTypoScriptFrontendController ()
 
- Protected Member Functions inherited from AbstractViewHelper
 callRenderMethod ()
 
 getLogger ()
 
 registerRenderMethodArguments ()
 

Protected Attributes

 $escapeOutput = false
 
- Protected Attributes inherited from AbstractViewHelper
 $controllerContext
 
 $objectManager
 

Detailed Description

A view helper which returns records with assigned categories

= Example =

<ce:menu.categories categoryUids="{0: 1, 1: 2}" as="pages" relationField="categories" table="pages"> <f:for each="{pages}" as="page"> {page.title} </f:for> </ce:menu.categories>

<output> Page with category 1 assigned Page with category 1 and 2 assigned </output>

Definition at line 38 of file CategoriesViewHelper.php.

Member Function Documentation

findByCategories (   $categoryUids,
  $relationField,
  $tableName = 'pages' 
)
protected

Find records from a certain table which have categories assigned

Parameters
array$categoryUidsThe uids of the categories
string$relationFieldField relation in MM table
string$tableNameName of the table to search in
Returns
array
Exceptions
Exception

Definition at line 87 of file CategoriesViewHelper.php.

References CategoryCollection\load().

Referenced by CategoriesViewHelper\render().

initializeArguments ( )

Initialize ViewHelper arguments

Returns
void

Definition at line 52 of file CategoriesViewHelper.php.

render ( )

Render the view helper

Returns
string

Definition at line 65 of file CategoriesViewHelper.php.

References CategoriesViewHelper\findByCategories(), and AbstractMenuViewHelper\renderChildrenWithVariables().

Member Data Documentation

$escapeOutput = false
protected

Definition at line 45 of file CategoriesViewHelper.php.