Skip to content
Advertisement

Symfony cascade persist or merge duplication

I have a problem with the cascade persist or merge, I have an application with two entities task and table (task_implements) When I create a task I choose cultures that are linked: If the user chooses 3 cultures => 3 tasks are created If the user chooses 3 cultures then 2 vehicles => 3 tasks must be created and each

Why can’t I use my instance in this trait?

I have this code trait GetCurrentConfigTrait { private static ?object $instance; private ?array $currentConfig; final public static function getCurrentConfig($name) { $class =…

laravel json data listing

I’m getting json data but I can’t list it in datatable Controller File public function index() { $data = Http::get(‘https://jsonplaceholder.typicode.com/posts’); return view(‘frontend….

regex skip match if its follows by whitespace and a keyword

Currently trying to match comments with regexes but only if no function follows. Currently I use a regex which also matches the keyword function. And then check in the source code (php) if this group is set or not. https://regex101.com/r/l0j1ip/1 Now the question is whether it is possible to realize with pure regex. I have tried it with a simple

How to list files inside public folder?

I have a persistent volume defined in server under www/public/images/logo/ I want to list all the files inside that folder. So far I have done following lines with no luck. Can anybody please help ? Answer If you are want to list all files on same server then you can use php function scandir(); If you are want to list

Custom Twig filter from bundle: Unable to load the runtime

I’ve a small twig custom filter in my project created following https://symfony.com/doc/current/templating/twig_extension.html . As long as it sits in src/Twig, it works as expected. Now I’m trying to move it to a custom bundle (vendor/turbolabit/tli-base-bundle/src/Twig/) to make it reusable. I moved the two files: I tagged it in services.yaml: (I also tried as tags: [twig.extension], even if it would be

Advertisement