miniCal
  • Quick Start
    • Introduction
  • miniCal Configuration
    • miniCal Hosted Service
    • Configure Feature Settings
    • Install Extensions
    • Create Multiple Properties
  • Local Installation
    • Local Installation
    • ENV Set-Up
    • Configuration Settings
    • Common Installations Errors
  • Contribution
    • Contribute to miniCal Core
  • Build an Extension
    • Build Your First Extension
      • Controllers
      • Assets
      • Config
      • language
      • Models
      • View
      • Helper
      • Library
      • Hooks
    • Open-source Extensions
    • Config Folder Files
      • Autoload File
      • Config File
      • Route File
    • miniCal Filters
    • miniCal Actions
    • Create Custom Hooks
    • Store Custom Data
      • POSTS
      • POSTMETA
      • OPTIONS
    • Composer Dependencies
  • Marketplace
    • miniCal Marketplace
  • Other resources
    • Overbooking for OTAs
    • miniCal Cron Setup
    • Automated Night Audit
    • Nginx Configuration
    • Docker Installation
    • Custom Domain Setup
  • Minical API Docs
    • API Documentation
  • Coming soon!
    • Access minical Data Using Helpers
      • Company Helper Functions
      • Customer Helper Functions
      • Booking Helper Functions
      • Rates Helper Functions
      • Rate Plan Helper Functions
      • Availability Helper Functions
      • Statement Helper Functions
      • Tax Helper Functions
      • Room Helper Functions
      • Charge Helper Functions
      • Payment Helper Functions
    • Access data in Extension
Powered by GitBook
On this page
  1. Build an Extension
  2. Config Folder Files

Config File

The config file contains all the extension's configuration details. Under the config folder you will find the config.php file, In this file use the $config variable and pass an array of key-value pairs. This array has all the configuration keys and values. This $cofig array will resolve in miniCal core automatically.

$config = array(
        "name" => "Minical Extension Boilerplate",
        "description" => "It is a sample boilerplate extension it contains the basic structure of a typical extension. It will show you the list of bookings.",
        "is_default_active" => 1,
        "version" => "1.0.0", // version of extension
        "logo" => "", // extension's log image
        "view_link" => "bookings_list", // view icon link
        "setting_link" => "bookings_list", // setting icon link
        "categories" => array("payment_process"), // category of extension
        "marketplace_product_link" => ""
    
    );

Below is a list of each key and its default values.

Key
Value
Requirement
Default value

name

This key contains the extension name as a value.

Required

"Extension name" (String)

description

This key will conation the short description of the extension.

Required

"Extension description" (String)

is_default_active

This key will specify whether this extension will be activated by default or not.

Required

0 (boolean)

version

This key contains the current version of the extension.

Optional

"1.0.0" (String)

logo

This key contains the extension icon path.

Optional

"" (String)

view_link

This key contains the route name of the page you want to load on this link click.

Optional

"" (String)

setting_link

This key same as the view link, except this key will load the setting page for the extension.

Optional

"" (String)

categories

This key reflected the extension category.

Optional

array('') (array)

marketplace_product_link

This key will have the link of extension of miniCal marketplace.

Optional

"" (String)

How to set custom configuration

miniCal allows us to set custom configurations along with the prefined key-values, pass your key-value pair into the config array.

$config = array(
        "name" => "Minical Extension Boilerplate",
        "description" => "It is a sample boilerplate extension it contains the basic structure of a typical extension. It will show you the list of bookings.",
        "is_default_active" => 1,
        "version" => "1.0.0", // version of extension
        "logo" => "", // extension's log image
        "view_link" => "bookings_list", // view icon link
        "setting_link" => "bookings_list", // setting icon link
        "categories" => array("payment_process"), // category of extension
        "marketplace_product_link" => "",
        "custom_key" => "custom value"
    
    );

"logo" this key contains the value path of the extension logo, you can place it inside of your extension folder inside any subfolder. You can name this subfolder accordingly.

For e.g.

 |->minical-extension-boilerplate
    |->images
       |->logo.png
     
 # for this particular example, the value of the logo key would be   
       "logo" => "images/logo.png"

How to use the custom configuration

For retrieving any configuration key use the given syntax below.

At the place of $this->module_name, you can also use your extension folder name.

Load configuration key on controllers/Models

$this->all_active_modules[$this->module_name]['custom_key'];

$this->all_active_modules['minical-extension-boilerplate']['custom_key'];

Load configuration key on Libraries/Hooks

$this->ci->all_active_modules[$this->module_name]['custom_key'];

$this->ci->all_active_modules['minical-extension-boilerplate']['custom_key'];

PreviousAutoload FileNextRoute File

Last updated 3 years ago