Check if Module is installed - Drupal 8
Using below example we can check if module is installed or not :
Using below example we can check if module is installed or not :
By default Drupal stores all configuration into database. Below example shows how to remove / delete configuration object of 'automated_cron.settings', i.e. remove cron settings.
Modules are used to extend and customize Drupal Core. To install module normally we can navigate to "Admin => Extend" link in toolbar.
Like older versions of Drupal, Drupal 8 doesn't allow modules to be enable / disable. The only thing we can do is either install a module or completely uninstall it.
Below example shows how to install module using code:
In Drupal 8, the Site Maintenance status is stored in State API.
To put Site in Maintenance mode or to get Site out of Maintenance mode, we can use following code snippet:
In Drupal 8, module's weight is stored into ConfigFactory. Here's how to get or set module weight.
Get module weight:
When building sites, many client wants users to get redirected to particular page (like Site Home Page) or page based on User Roles. Today we'll see how we can redirect user after login to particular page.
NOTE: I've defined my own custom page using [MODULENAME].routing.yml named as "custom.redirect_callback", which we'll be using for redirecting user.
Recently Acquia held a webinar about "Drupal 8 Preview: What to Expect". The webinar was presented by webchick. In This webinar, she is going to outline how D8 will help you if you are: an end-user, site-builder, front-end developer, or a hardcore nerd.
YouTube Preview: