Skip to content

Template management

Template for generating code.


Template grouping

Group Name: Group name

Template list

Template Name: Template name

Template information

GroupCurrent group name
TemplateCurrent template name
PackagePackage names
PathCode generation storage path (excluding project path, see Project Management)
Codecode segment

Template properties

Basic attributes
authorAuthor (nickname of currently logged in user)
current_timecurrent time
project_packageProject absolute path
packageCurrent template path
table_nameTable Name
table_commentTable Comment
fieldsFor all field information, refer to field properties
Field properties
nameField name
commentField annotation
field_typeData type (database)
data_typeMapped data type, management data type
data_type2mapped data type
data_type3mapped data type
ordinal_positionposition in table
column_defaultdefault value
is_nullableWhether it can be empty (YES: NULL is allowed; NO: NULL is not allowed)
column_keyKey type (primary key: PRI; unique key: UNI; normal index: MUL)
extraextra information
Tool properties
camelcaseConvert underscore string to camelCase hello_world => HelloWorld
camelcase_lowerConvert underscore string to camel case (first letter lowercase) hello_world => helloWorld
package_to_pathConvert package name to path

Usage examples:table_name|camelcase

Basic grammar

Commonly used markers

comment:{# This is a comment #}

variable:{{ table_name }}、{{ }}

list:{{ fields[0] }}

multi-line code block:{% start %} HTML {% end %}
tool properties:{{ table_name|camelcase }}

Conditional judgment

Basic usage

{% if condition %}
  # Conditional code block
{% else %}
  # Unqualified code block
{% endif %}


{% for field in fields %}

{% endfor %}