PHP code example of alexandrebulete / ddd-sylius-bundle
1. Go to this page and download the library: Download alexandrebulete/ddd-sylius-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
alexandrebulete / ddd-sylius-bundle example snippets
use AlexandreBulete\DddSyliusBundle\Admin\Menu\MenuContributorInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
#[AutoconfigureTag('app.menu_contributor')]
final readonly class PostMenuContributor implements MenuContributorInterface
{
public function contribute(ItemInterface $menu): void
{
$menu
->addChild('posts', [
'route' => 'app_admin_post_index',
])
->setLabel('Posts')
->setLabelAttribute('icon', 'tabler:article');
}
}
use AlexandreBulete\DddSyliusBundle\Grid\GridPageResolver;
$page = GridPageResolver::getCurrentPage($grid, $parameters);
$itemsPerPage = GridPageResolver::getItemsPerPage($grid, $parameters);