Skip to content

Instantly share code, notes, and snippets.

View MarioBlazek's full-sized avatar
🎯
Focusing

Mario Blazek MarioBlazek

🎯
Focusing
View GitHub Profile
$container->registerForAutoconfiguration(ExtensionInterface::class)->addTag('twig.extension');
php bin/console debug:container App\Twig\TwigExtension
Describes a logger instance.
Psr\Log\LoggerInterface (monolog.logger)
Psr\Log\LoggerInterface $buzzLogger (monolog.logger.buzz)
Psr\Log\LoggerInterface $cacheLogger (monolog.logger.cache)
Psr\Log\LoggerInterface $consoleLogger (monolog.logger.console)
Psr\Log\LoggerInterface $debugLogger (monolog.logger.debug)
Psr\Log\LoggerInterface $doctrineLogger (monolog.logger.doctrine)
Psr\Log\LoggerInterface $eventLogger (monolog.logger.event)
Psr\Log\LoggerInterface $httpClientLogger (monolog.logger.http_client)
Psr\Log\LoggerInterface $lockLogger (monolog.logger.lock)
<div class="name">
<p>{{ item.name }}</p>
</div>
netgen_layouts:
query_types:
the_cat_api:
name: 'The Cat API'
view:
item_view:
default:
the_cat_api_value_type:
template: "@nglayouts/value/the_cat_api.html.twig"
match:
app.collection.query_type.handler.the_cat_api:
class: AppBundle\Layouts\QueryType\TheCatApiQueryType
arguments:
- '@app.integration.cat_api_client'
tags:
- { name: netgen_layouts.query_type_handler, type: the_cat_api }
<?php
namespace AppBundle\Layouts\QueryType;
use AppBundle\Integration\TheCatApi\Service;
use Netgen\Layouts\API\Values\Collection\Query;
use Netgen\Layouts\Collection\QueryType\QueryTypeHandlerInterface;
use Netgen\Layouts\Parameters\ParameterBuilderInterface;
use Netgen\Layouts\Parameters\ParameterType;
app.integration.value_converter.the_cat_api:
class: AppBundle\Integration\TheCatApi\TheCatApiValueConverter
tags:
- { name: netgen_layouts.cms_value_converter }
<?php
namespace AppBundle\Integration\TheCatApi;
use AppBundle\Integration\TheCatApi\Value\TheCatApiValue;
use Netgen\Layouts\Item\ValueConverterInterface;
class TheCatApiValueConverter implements ValueConverterInterface
{
public function supports(object $object): bool
<?php
namespace AppBundle\Integration\TheCatApi\Value;
class TheCatApiValue
{
/**
* @var string
*/
private $id;