Документация InstantCMS

для администраторов и разработчиков

Инструменты пользователя

Инструменты сайта


en:dev:forms:create-field:main-file

Main field file

The main field file is a file with the field class, in which the main logic of the field is defined.

Language constants are defined in the /system/languages/{YOUR_LANGUAGE}/language.php file and look like LANG_PARSER_{FIELD}_{NAME}, or you should create a language file for Your /system/languages/field_{field_title}.php field in which the language constants will be defined

Location

The main field file is located in the fields system folder /system/fields/{field title}.php

Example: /system/fields/myfield.php

Field class

In the main file, a field class with the following title should be defined:

field{Field_title}

The class should be inherited from the cmsFormField system class.

Example class fieldMyfield extends cmsFormField

Variables

The following variables can be declared inside the class:

  • title – sets the title to your field in the Control panel, for example: public $title = 'My field';;
  • sql – detects your field’s type in the database, for example: = 'varchar(255) NULL DEFAULT NULL';'';

The page is being written

en/dev/forms/create-field/main-file.txt · Последнее изменение: 27.03.2017 23:46 — murlysja

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki