survos/core-bundle

Traits and Interfaces common to other Survos bundles

Fund package maintenance!
kbond

Installs: 2 986

Dependents: 11

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.5.205 2024-03-05 19:16 UTC

This package is auto-updated.

Last update: 2024-04-17 16:18:22 UTC


README

Symfony Bundle with interfaces, traits, models and services needed by more than one Survos components. For example, Model\Column is used by grid, api-grid and simple-datatables. RouteParametersInterface is used by tree and the griid bundles.

composer config repositories.survos_core '{"type": "path", "url": "/home/tac/survos/bundles/core-bundle"}'
composer req survos/core-bundle:*@dev
<?php
// src/Entity/Foo.php
namespace App\Entity;

use Survos\CoreBundle\Entity\RouteParametersInterface;
use Survos\CoreBundle\Entity\RouteParametersTrait;

class Foo implements RouteParametersInterface
{
use RouteParametersTrait;

public function getUniqueParams(): array { 
    return ['fooId' => $this->getFooCode()];
}

Now use .rp in twig and ->getRp() in php as part of generating a route

<a href="{{ path('foo_show', foo.rp) }}">Show</a>

Combined with survos/maker-bundle, create a param converter

bin/console survos:make:param-converter Foo

Helper Tasks

echo "SYMFONY_DEPRECATIONS_HELPER=weak" >> .env