Download the PHP package thelia/thelia-studio-module without Composer
On this page you can find all versions of the php package thelia/thelia-studio-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package thelia-studio-module
Thelia Studio
author: Benjamin Perche [email protected]
This module allows you to generate all the repetitive classes and templates you have to write for a module.
-
Installation
Install it as a thelia module by downloading the zip archive and extracting it in or by uploading it with the backoffice, or by requiring it with composer:
-
Usage
This module adds two commands:
and
-
Generating your module configuration form
To do that, you will need to write a new file. Create in your module's Config directory, and by respecting the following structure, TheliaStudio will generate everything for you :) :
- the root node is called 'config'
- then write your config for simple ones.
- available types are: text, textarea, integer, number, checkbox.
- you can add more precise data into the generation:
- to customize the name of the field displayed in the configuration page
- if the field isn't required
- a validation regex.
- an array with "min" and "max" keys.
- a help message for the field displayed in the configuration page
Here's an example:
-
How to use it ?
4.1 Generate the configuration form only
First, write your config-form.yml Then launch Finally, adapt the generated template for your need.
4.2 Generate table CRUD and configuration form
4.2.1 Writing the schema.xml
If you want your table to be correctly integrated into Thelia, you have to respect some conventions.
- Always call your primary key and never construct the PK with two columns.
- If you want a visibility toggle, call your column and give it the type or
- If you want a position management, call your column . The order argument for the loop will be called manual
- If the column is called 'id', 'title', 'name' or 'code' its entries in the table will be a clickable link
- If the column is a or a type, it will be used as a checkbox.
- If the column is called 'chapo', 'description' or 'postscriptum', it won't be displayed in the table
Here's a typical schema that will work like a charm with TheliaStudio:
4.2.2 Generating everything
Write your schema.xml, then if needed write your config-form.yml You can now launch , your can use the --table option to specify the tables you want to generate.
Go to the directory and change the form names that you want. You can change the generated templates as you want, as the generator integrates everything, everywhere, even if it's not needed.
4.2.3 Automatic support for some standard Thelia features
The module will generate the appropriate code for managing 'position' and 'visible' fields if the table has columns with these names.
The module will automaticaly generate the code for managing standard Thelia SEO fields (including a rewriten URL) if the table has the following columns :
- meta_title
- meta_description
- meta_keywords
-
Access to the generated pages
The CRUDs are generated under You can write a hook to access it from the dropdown or add links into your module configuration page.