Skip to content

Instantly share code, notes, and snippets.

@johannessteu
Last active August 29, 2015 14:11
Show Gist options
  • Save johannessteu/9379999aa960f51e2c52 to your computer and use it in GitHub Desktop.
Save johannessteu/9379999aa960f51e2c52 to your computer and use it in GitHub Desktop.
Create a custom FlowQuery
<?php
namespace Vendor\Package\FlowQuery;
class ResourceUrlOperation extends \TYPO3\Eel\FlowQuery\Operations\AbstractOperation {
/**
* {@inheritdoc}
*
* @var string
*/
static protected $shortName = 'custom';
/**
* {@inheritdoc}
*
* @var boolean
*/
static protected $final = TRUE;
/**
* {@inheritdoc}
*
* @var integer
*/
static protected $priority = 100;
/**
* @Flow\Inject
* @var ResourcePublisher
*/
protected $resourcePublisher;
/**
* Explodes a comma-separated string with tags and fetches all assets that are tagged with those tags
*
* @param \TYPO3\Eel\FlowQuery\FlowQuery $flowQuery the FlowQuery object
* @param array $arguments the arguments for this operation
* @return mixed|null if the operation is final, the return value
*/
public function evaluate(\TYPO3\Eel\FlowQuery\FlowQuery $flowQuery, array $arguments){
// do something
return '';
}
}
result = ${q(node).custom()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment