I want to select an element/div tag by using XPath (Symfony Dom Crawler):
$element->filterXPath('//span[text() = "SOMEtext"]')->text();
It works fine if there are no special characters in the string.
It won't work if a string contains the accents or…
I'm trying to use the translation component but I'm not able to get it - and use - properly.
When I request /testT:
namespace Codechick\Test2Bundle\Controller;
class DefaultController extends Controller
{
/**
* @Route("/testT")
*/
…
I want to use the Symfony console component to make a command like this:
app/console config:set someConfigName=someValue anotherConfig=anotherValue
I found this question: Variable number of options for symfony/console component
But it seems…
In my recent project, working on console command where I need to perform/run various action mentioned in json based on the linux standard convention as
what:mv(Move),type:file,dir
what:mkdir(Make Directory)
what:touch(Make File)
what:cp(Copy),…
I am using the optionsResolver component of symfony
I have the following code:
public function test($group, array $options = [])
{
$this->resolver->setDefaults([
'query' => ['group' => $group],
'form_params' => ['user' =>…
I would like to remove unwanted effect of redirecting when somewhere is thrown AccesDeniedException. I mean redirecting to "login" page if user is not authenticated.
I created kernel.exception listener
class ApiAccessDeniedListener implements…
I want to find specific texts in some files in a directory. I tried using Symfony Finder Component, but couldn't get the result. Here is my code below.
$finder = new Finder();
$finder->in('./sample')->files()->contains('This is test');
The files…
I don't how to explain this so please be easy on me.
The router holds the uri variable key
$router = 'movie/english/{slug}/edit/(id}/{title}';
The URI in the browser address bar
$uri = 'movie/english/scorpion/edit/125/E01E05';
How can I write the…
How can I pass a dynamic dependency from one registered container definition to another? In this case, a generic Database object wants to inherit from a generic Config object. The twist is config is not static, but loaded depending on a given…
I built a console app with Symfony Console component. It supposed to be run for 5 hours. But after running 2 hours i have a proc_open(): unable to create pipe Too many open files error in Symfony\Component\Console\Application.php on line 985.
I…
I'm having a little issue using Silex and security service.
When a user enter his data (correctly) into my login form, it doesn't get redirected to app url. He remains in the same page, and debuging, in the login form page, donesn't have anything in…
Background
Part of my application's responsibility is handling requests for static resources (CSS, JavaScript, images) in a controlled manner. Based on some application logic, it will return one from a selection of different files that might be…
I have a question about the dom crawler, or more specifically, the CssSelector Component. When I run
$descendants = $crawler->filter('ul > li');
on a multi dimensional list, I get all direct children. But when I run
$descendants =…
Using DI as a standalone component in the small part of the codebase I want to make some services visible outside this part and accessible as by interface class name.
As I know, I should use a container for this.
So when old part of the code (that…