Module

Config

Introduction

This Guide will help you to understand, how to use config variables in VaahCMS. How we can use those variables in config file to show the necessary details to our users like app_name, VaahCMS current version, documentation link, php_version_required etc.


Usage

All those informations that we want to access in our particular module, for that we need to go to following location: VaahCms/Modules/Travel/Http/Controllers/Backend/BackendController.php

Follow below image for reference:

In the BackendController.php file, there is a function named as getAssets, this function is responsible for accessing those variables defined in config file and displaying them on the front end.

Follow below image for reference:

Examples

  1. Suppose we want to change our module name from the footer section, for that we need to go to following location: VaahCms/Modules/Travel/Config/Config.php

Follow below image for reference:

Here if we change the value of name key, it will be reflected in the footer section of vaahCMS.
Before change:

After change:

  1. If we want to access the information like app_version, app_name, version, documentation link etc then we need to go to following file.

vaahcms/config/vaahcms.php

Follow below image for reference:

These variables are accessed in getAssets function of BackendController.php


Copyright © 2024