Skip to main content
Stéphane Quantin

Main navigation

  • Portfolio
  • About
  • Freelance Drupal
    • Audit de site Drupal
    • Drupal maintenance contract
  • Blog
  • CV
  • Contact
Languages
  • French
  • English

Breadcrumb

  1. Home

Blog

Drupal 8: programmatically test if the current page is the home page of the site

Drupal 8 : programmatically test if the current page is the home page of the site.

Drupal 8 - Formatting a date field in Twig

Displaying a date field may seem trivial in a Twig template in Drupal 8, but it is sometimes desirable to want to control the rendering of this field. Here are three ways to display Date fields in a Twig template.

Drupal 8 - Get the current language programmatically

Drupal 8: retrieves the current language programmatically, in ISO 639-1 form or directly the name of the language.

Configurer Drush : alias et options

Configure Drush: aliases and options

Drush configuration is in the file drushrc.php. It can be located in the following locations:

symfony 1.4 : pass parameters on table_method in a sfWidgetFormDoctrineChoice

The widget sfWidgetFormDoctrineChoice accepts option 'table_method', where you can define a method that returns a query, a collection of objects or a single object. This allows you to customize the results of our widget.

However, the problem is that it is impossible to pass parameters to this method, which may be necessary. One solution is to create a custom widget that accept parameters to it.

Select a custom column with Propel in Symfony 1.4

Here's a snippet, which allows you to select only one column in a query, and access to the result in symfony.
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(objectPeer::COUNTRY);
$c->setDistinct();
$res = objectPeer::doSelectStmt($c);
while ($row = $res->fetch()) {
$country = $row[0];
}
?>

Works with Propel 1.4 and symfony 1.3/1.4.

Blog

Social networks

  • Malt
  • codeur.com
  • 404Works
  • LinkedIn
  • Twitter
  • DoYouBuzz

Tweets by StephaneQ

RSS feed

Pied de page

  • Contact
  • Mentions légales
Powered by Drupal