I would like to get the value of the column uid from all rows where the value of the column city is london. I have tried it like this: $this->getDoctrine()->getRepository(Personal::class)->…
Tag: symfony
“SplFileInfo::getSize(): stat failed” exception on Laravel 6.0 when doing file upload
I’m using Laravel 6.0 to build a simple image upload system. But for some odd reason, I keep encountering a “SplFileInfo::getSize(): stat failed” exception even though the image is successfully …
Doctrine QueryBuilder – CASE WHEN
I have a question about case when in doctrine. The problem with this is when uim.isProfileImage is 1 for a user, that returns that row and every other row in user_image table for that user. What I …
Symfony routing: only `/` page is working
I’m having a strange symfony problem. I’m trying to play with Symfony 3.4 and nginx. I follow the “Create your First Page” tutorial but, only**/symfony/Symfony/web/app_dev.php** page is working when …
How do I get a service from the container directly, if I didn’t/couldn’t inject the service using DI?
I have a part of code where I’m injecting two services $checker and $paginator by dependency injection. It works perfectly: public function index(Request $request, Paginator $paginator, Checker $…
select2 does not display correctly (Using cdn)
I’m trying to complete my website with some java’s plugin, I’m on Symfony 4 and I use the CDN bootstrap twitter. When I put the select2 plugin into the templates all is working properly, the select2 plugin does apply correctly. However I don’t want to load select2 directly from the templates I want to run it from app.js but it
Attempted to call an undefined method named “getEntityManager” of class
I’m learning symfony and I would like to have a search bar to show user with email. But I got and error Attempted to call an undefined method named “getEntityManager” of class “AppRepository…
Symfony OneToMany Assiociations not working
I have Product entity and ProductAttachment entity. One product should be able to have many attachments. I Used Doctrine mapping OneToMnay – ManyToOne but everytime i get product, it has empty $files collection ProductAttachment Entity Product Entity Am i Missing anything? When i call this is what i get Answer The problem is Doctrine’s lazy loading of collections, which is
How to inject global variables into all templates?
In my twig template there are some variables that are required on each page like userName, userId or userImage. What is the best way to inject them into the template? I already read the article How to Inject Variables into all Templates but how could I write a variable (e.g. current user) into the config/packages/twig.php file? Right now there is
How to design a simple plugin based on pico CMS without using required_once?
I’m hoping to design a simple plugin based on pico CMS and call it in a protected function in my main class, called App. Plugin is called AppHelper. Attempt I added a required_once on the top of App class: and tested using this (which first AppHelper::isMobile is not right): in a protected method: and works okay with just a warning.