I’m working on a proof-of-concept app based on pico CMS, and I’m hoping to create a simple plugin to add some basic methods to it. You can view plugin files in this link and app files in this link. How do I add this plugin and call isMobile();, for example? AppHelper plugin Answer Do not use static methods in plugins.
Tag: symfony
“AppEntityUser object not found by the @ParamConverter annotation”
I have a problem with one of my route when I try to access it, I have this error : “AppEntityCompanyUser object not found by the @ParamConverter annotation” Many people have the same problem but …
How to use the logger in a console command on Symfony 4?
I’ve recently gone from using Symfony 2.7 to 4.2. Previously in my commands in order to log to a file I used something like: This functionality appears to have changed. I can log from a controller following https://symfony.com/doc/current/logging.html I can output to the console using: But as much as I stare at the information on the symfony website I just
How beautifully to stop object property validation on the first error in Symfony?
I have the following code: class User { /** * @AssertType(type=”string”) * @AssertNotBlank() * @AssertEmail() * @AssertLength(max=255) */ public $email; } This object is filled from an API call. When validation takes place and property is filled with array value instead of string then NotBlank, Email, and Length validations continuing to work and I get “UnexpectedTypeException”. I want validation system
Laravel 5.4 environment based config files
I am trying to change the Laravel configuration variables based on environment, but I do not know how. Code to get config is I am trying to have a separate results for the live environment and the development environment. Real life scenario I need to override some config files, so everybody who is using the development environment, has the same
Symfony 3.4 – The service “SymfonyComponentLdapLdap” has a dependency on a non-existent service “SymfonyComponentLdapAdapterExtLdapAdapter”
Edit: My issue was resolved, see at the bottom of the post. i’ve been trying to connect to a LDAP with Symfony 3.4 and i’m having quite troubles here. i’ve setup my services.yml and security.yml …
Using HTML.PHP instead of html.twig – not working
class DefaultController extends Controller { public function indexAction($page, $name) { return $this->render(‘default/new.html.php’ // , array( // $name =&…
Checking which form field value has changed Symfony 3
I need to check inside the FormType which field has changed. Is there any method to do it? I’ve searched for a while, then tried to get edited entities field in few ways (with form events too) to catch the edited fields, but no simple result. Is there any way to do it easy, or I need to be more
Can’t login with Symfony Guard, maybe because of cookies & multidomain
I need a very simple form login, so I’m using a Symfony Guard authenticator for this. My application is multi-domain, for now login is possible on only 3 of them (and 2 are subdomains). But I can’t log in on any of them. First, here are some resources: The authenticator: FormLoginAuthenticator.php My security configuration: [https://gist.github.com/Pierstoval/1e29a9badab1cba03e45a306aa658c83#file-security-yaml) And in case it’s needed,
How to get query string in Symfony 4
I am trying to access the query string parameters in Symfony 4 namespace AppController; use SymfonyComponentHttpFoundationRequestStack; class Home extends Controller { private $request; …