Skip to content

Configuration

Alexander Stoimenov edited this page Jun 21, 2016 · 1 revision

The install command publishes igniCMS' config files automatically. This contains:

  • admin/bootstrap.php
  • admin/seo_page.php
  • admin/sidebar.php
  • admin/user.php
  • and config files for the package dependencies

Bootstrap config

In admin/bootstrap.php you can configure:

  • the project name (that will be displayed in the CMS itself)
  • the default form view
  • the paginate limit of the CMS listing
  • the paths where various files (models, controllers, migrations, etc.) will be created by the CMS when you create new resource.

Sidebar config

In admin/sidebar.php is described the structure of the CMS' sidebar. It represents an array with the items that you need in the sidebar. The properties of these items are:

  • name
  • link - route that you want the item to point to, it uses the 'dot notation' (e.g. 'admin.users.index'). If you don't want the item to open certain page, but only to expand some subitems, than set the value to the 'hash symbol'(#)
  • isActive - in most cases you should set this to false and change it to true in the corresponding resource controller
  • iconClass - Font Awesome icon class
  • permissionsNeeded - here you can specify a permission for the current item, in that way it can't be accessed from user with role that doesn't contain this permission. The CMS provides the required resources for creating new permissions and user roles
  • subMenu (optional) - an array of menu item described the same way as the main sidebar. If you use this property you should set the link property to the 'hash symbol'

Resource config files

When you run the resource command it automatically creates a config file for the resource. The CMS comes preset with config files for two resources (user and SEO page), that you can alter or use as example.

Mainly these type of config files consists of an array with two main (required) items - adminColumns and adminFormFields. If you need images for your resource you can have one more main item - image_fields.

  • adminColumns - an array representing the columns of the list (index) view of the resource. It consists contains the following items:
    • name - the name of the column
    • db_field - the name of the field (column) in the database table where the resource is stored
    • type (optional) - if you want the column value to be formatted in a certain way, the CMS provides several common format types:
      • yes_no - converts boolean value to yes/no
      • format_default_date - formats timestamp value into a human readable ('F jS, Y') format
      • sort - sets the value of the table cell to a sortable handle (see rutorika/sorable repo for more information about sorting an resource)
  • adminFormFields - represents an array with all fields that you need in order to create/edit the resource. The key for an item is the name of the field that will be used in the request. From there the item itself is again an array, that consists of:
    • type - the type of the field. You can choose from: checkbox, color, date, imageSingle, manytomanySelect, password, select, text, textarea and wysiwyg
    • label
    • help - you can show additional information under the image fields

Clone this wiki locally