Adding custom submit handler to form in Drupal 8

By default in a Drupal 8 form submitform($form, FormStateInterface $form_state) will handle the the submission of form values. However we can also add our own submit handlers easily with Drupal 8 form api. The below example explains that. Add the custom submit handler function with class name in the $form[‘#submit’] array   namespace Drupal\lnformcontrol\Form; use Continue Reading

Adding parameters to route in Drupal 8

To pass parameters to controller using URI is possible in Drupal 8. It makes URI to contain parameters that can be processed in the controller.Parameters are defined in the routing.yml with curly braces.Following is the example code to pass parameters to route in routing.yml file. hello_world.hello_route: path: ‘hello/{route}’ defaults: _controller: Drupal\hello_world\Controller\HelloController::hello_route _title: ‘This is title Continue Reading

Creating a simple Hello module in Drupal 8

Drupal 8 is has many advanced CMS features with using the most advanced features of PHP language and integrates number of third party libraries.  Drupal 8 makes use of OOP concepts heavily while using PHP classes, objects, namespaces and many design patterns using these.  Symfony is a PHP framework that Drupal borrows from in order Continue Reading