Skip to main content

Posts

Showing posts from 2022

Set up Apache virtual host on Windows 10 with xampp

There are following steps to create virtual host Step 1:- Update the host file on window 10. Go to the following path " C:\Windows\System32\drivers\etc ". Open host file then add the below line. 127.0.0.1       local.drupal.com Step 2:- Update the vhosts file in Apache configuration. Go to the following path " C:\xampp\apache\conf\extra ". Open httpd-vhosts.conf file then add below line. <VirtualHost *:80>     DocumentRoot "C:/xampp/htdocs/drupal/"     ServerName local.drupal.com     <Directory "C:/xampp/htdocs/drupal/">     </Directory> </VirtualHost> Step 3:- Check one more configuration in the httpd.conf file on the following path "C:\xampp74\apache\conf\httpd.conf". Remove preceding # character from below line in httpd.conf file. Include conf/extra/httpd-vhosts.conf Step 4:- Restart XAMPP.

How to create custom events in drupal9?

In this section, we will learn how to define custom event, how to dispatch custom event and how to subscribe custom event.  There will be following things which we we will see step wise step : Step 1 :- Create modulename.info.yml file where filename is "drupal_custom_events.info.yml" , here our module name is "drupal_custom_events". name: Drupal Custom Events type: module description: 'This module will guide us about drupal events.' package: Custom version: 1.0 core_version_requirement: ^8 || ^9 Step 2 :- Create a routing file drupal_custom_events.routing.yml where we will define a route and call a form.  drupal_custom_events.custom_event_dispatch_form:   path: 'event_dispatch_form'   defaults:     _form:  '\Drupal\drupal_custom_events\Form\CustomEventDispatchForm'     _title: 'Event Dispatch Form'   requirements:     _permission: 'administrator' Step 3:- Create a Events folder inside src folder then create a file "Cu...