This tag is for questions related with how Drupal utilizes Symfony components.

learn more… | top users | synonyms

0
votes
1answer
30 views

How is the class loader set to load the files containing classes?

I was trying to understand how Drupal 8 initializes the class loader to look for files containing classes in core/lib and modules/*/src. I found out that the class loader is set to an instance of ...
0
votes
1answer
19 views

Modifying argument of programmatically called render service. (e.g.: theme to use) = Get object from service container with modified argument

I use the D8 core render service for generating markup that is indexed in an external search service. The indexing is happening on hook_entity_update, where I call my indexing service. My custom ...
2
votes
1answer
38 views

Can't log in user with Rest service [duplicate]

i'm trying to build a Headless Drupal app with symfony, i'm stuck with login, i build a custom module for drupal 8 with four functions, (login,logout,register,login_status): <?php /** * @file * ...
0
votes
0answers
41 views

Drupal 8 MVC: is there a Model?

Coming from a Drupal background, I am quite thrilled at the idea of working with drupal 8 and symfony proper OOP and MVC practice. Right now I I am building a module with a service and a controller ...
0
votes
2answers
35 views

How does the events dispatcher map to map_save to a callback function?

MigrateEvents.php contains an event definition like this: /** * Name of the event fired when saving to a migration's map. * * This event allows modules to perform an action whenever the ...
1
vote
1answer
89 views

Error running a PHPUnit test only under run-tests.sh

I'm working on an 8.x module that uses PHPUnit tests. I've been running these from the command line using the embedded phpunit script that's installed with Drupal 8: ../vendor/bin/phpunit ...
0
votes
1answer
548 views

How can I tell Guzzle to safely ignore ssl.certificate_authority in Behat testing? (Development server)

On a sandbox install of Drupal running behat under the Behat Drupal Extension, I'm trying to fun the following feature: @api Scenario: Logged in User Given I am logged in as a user with the ...
0
votes
1answer
85 views

Passing HTML to the response object

I had this piece of code in a module developed for some previous version of Drupal 8. protected function getOutput() { $content = $this->buildContent(); //print_r($content); $page = ...
3
votes
1answer
786 views

Replace Standard Node Path in Drupal 8

I am still new to all the Symfony semantics. What would be the easiest way to change node canonical urls to be /article/[node-title] instead of /node/[node-id]? Following this documentation I tried ...
2
votes
1answer
127 views

Is it possible to pass Drupal config values as arguments to services?

I'm writing a module that makes calls to a Web service to read and store data. Here's my services.yml file: services: example.connection: class: Drupal\Core\Http\Client I've already a ...
11
votes
2answers
6k views

Should I learn Symfony 2?

I saw this, How much of Drupal 8 will rely on or be compatible with Symfony? but I don't understand if it applies to my question. Should I learn Symfony 2 to develop with Drupal?
1
vote
1answer
217 views

Is updating the composer.json file & consequently composer.lock in Drupal 8 considered a good practice or hacking the core?

I have been working with another developers on a scaffolding tool for Drupal8 based on Symfony Console component. The current setup process includes updating composer.json using composer CLI: ...
17
votes
1answer
2k views

Why are routing files filled with underscores?

What is the deal with all the parameters with, and without, a prefixed underscore character? Where does Drupal decide how to process these parameters? Was this concept introduced from Symfony, or is ...
4
votes
1answer
285 views

What arguments can I use when defining a service?

Looking at system.services.yaml, I noticed that some of the services arguments are strings starting with @. They seem to contain a reference to another defined service. system.manager: class: ...
2
votes
1answer
86 views

Is there any case where a module needs to implement a class using ServiceProviderInterface?

Drupal defines the CoreServiceProvider class which is used to add the twig, twig.loader.filesystem, and module_handler services. Since the Drupal 8 way to register a service from a module is using ...
8
votes
3answers
919 views

Is it acceptable to modify Drupal's composer.json file?

Drupal adheres to the best-practice of never modifying core. Drupal 8 has a composer.json file built into core, if you need to add a third-party library, should you modify composer.json, or is there ...
5
votes
3answers
339 views

Lime for Drupal 8?

Now that Drupal 8 is going to be based mostly on Symfony, is the TDD/unit-testing going to change too? For Symfony, Lime is the preferred testing-suite. Is that true for Drupal8?
3
votes
1answer
613 views

How much of Drupal 8 will rely on or be compatible with Symfony? [closed]

Now that Drupal 8 is being redeveloped with Symfony, and we are just about to go into the code freeze so that early adopters can start playing with it, what will it affect? Will we be able to write ...
0
votes
1answer
346 views

Symfony2 authentication and Drupal 7

I am currently developing a website using the framework Symfony2. I am nearly at the end of its development, and just the "security" part is missing (authentication and authorization). What I would ...
4
votes
2answers
771 views

Creating Drupal 8 route for AJAX requests

How should I implement a callback to a single Drupal class (in my case it's Transliteration). I don't need a full Drupal load/bootstrap, but one independent class. The purpose of the AJAX code would ...
9
votes
1answer
696 views

How can I install composer packages with drush make?

How does one include composer package in a drush make file? The more general answer, the better. There's already a composer drush module allowing drush dl to handle composer packages, but that ...