Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in
By editor , 11 October, 2019

Run PHP script using drupal bootstarp on drupal site

Tags

  • Drupal 8
  • Code
  • PHP

This is usefull if you want to do some actions just one time.

The drush comman is php-script alias src

On drupal 8 with drush

Example :
drush --uri=drupal.loc scr /modules/custom/mymodule/scripts/test-script.php

By nuwantha , 20 September, 2019

PHP RegEx Replace accents of each selected word

Tags

  • PHP
  • Code

Example :

$stopwords = ['toto', 'Pied', 'the'];
$str = 'bla bla toto bla bla Toto bla bla Tôtô bla bla totô bla bla bla bla the thé pied pïed pîéd';

By editor , 1 November, 2018

Alter Views title programmatically on Drupal 8

Tags

  • Drupal 8
  • Code
  • Views
  • Hook

function MYMODULE_views_pre_render(ViewExecutable $view) {
 if ($view->id() == 'ABC') {
  $view->setTitle('MY CUSTOM TITLE');
 }
}

By editor , 21 June, 2018

Create Drush 9 Commands For Drupal 8

Tags

  • Drupal 8
  • Code
  • Drush

Drush 9 is finally here with some much-awaited changes. Drush 9 commands are now classes and .inc files are obsolete. Drush commands will now be based on the Annotated Command format. This will change the fundamental structure of custom Drush commands.

By editor , 13 June, 2018

Connect to a PPTP VPN Server from Linux Terminal

Tags

  • Linux
  • Services

Step 1 : Install pptp client.

sudo apt-get -y install pptp-linux


Step 2 : Setup PPTP Client

Add secret:

File : /etc/ppp/chap-secrets
You can use:
sudo nano /etc/ppp/chap-secrets

Pagination

  • First page
  • Previous page
  • …
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • Page 12
  • …
  • Next page
  • Last page

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer