I’ve encountered a new issue on my Symfony application and I cannot find anything to help me. In my database, a user has an activation_token field. When the user creates his account on my website, it …
Validating non-required associative array with required fields
I want to validate that if my request contains a field of associative array type, that array needs to contain specific fields (but only if it’s present) Ie, array, if present, needs to contain foo: and is fine, but and is not. I’ve written this validator: But it doesn’t accept the first scen…
Session_start() after defining a constant
on every page (first lines, first code) I have those two lines of code: after those two lines of code, I always do session_start();, I read that session_start() should come as a first thing, before anything. Session_status() shows that session is active and working properly, so I have a couple of questions: 1…
Change parent format from @Template to render
When updating the app from Symfony 2.8 to Symfony 3.4, the handling of _format changed, so I would like to change @Template to render as shown in the post below. However, because twig is changed in Parent format Unable to specify twig file in return of BaseStaffController.php. Is there any good way? How to re…
Boostrap Select
It doesn’t show output <option>. It shows only the select with no element inside. I’m using bootstrap-select library. What’s the problem? Answer You don’t have any problem: It’s working here: Try to set the function like this (inside script tag):
Woocommerce Shipping method based on user role
I want to enable or disable Shipping Methods, according to user role. I have tested various different codes and approaches, none of which have worked so far. The current code: (source: stacklink ) (Have tested the original snippet as well, without changes, accept for the user role ) Does not work for me. I te…
Composer outdated command doesn’t show latest versions [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I am using Composer version 2.0.8, with Docker. When I use the command composer outdated -f js…
Laravel | How to use Pivot table with Relationship
I have a question about the relationship. I have an activity model and controller. I guess I searched a lot, I find an attached method for this. But idk how to use it. I have an activity table like this: And another table is activity_asset like this: Now I don’t know how to relate these two tables. What…
Issue with Storage on shared hosting
I am deploying my first project on a shared hosting. I followed this tutorial to deploy the website and turn the public folder into the public_html folder of my hosting plan. When I upload an image from my website (with storeAs() method), the file is uploaded in the private/storage folder, not the public one …
How to rewrite an echo function to a return value for a WordPress theme
I am new to PHP and I am glad that I have written the following function (which works as it should) on my own so far: But now I definitly need your help… As you can see I want to use this function in a shortcode. Currently it displays first on my page, and Google says, this is because I