Skip to content
Advertisement

Tag: symfony

Adding a plugin to a simple app using PHP/Symfony/Twig

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.

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

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,

Advertisement