Gy - php framework/CMS | Documentation | –°ontainer Data

<-- table of contents

Data container (container_data)

These are entities made to store various data. such as page content. You can create a data container, give it a name and code, set properties for the current data container (as long as there is html and a number), then you can create elements of this data container (the name, code and property value). You can set an unlimited number of properties for the data container.

Work with the data container from the admin panel

You can work by going to the admin panel gy next to the "Data Containers" tab, on the page that opens there is a list of currently defined data containers (by default. After installation, for example, there is a container with Content code and one element).

Here you can create a new data container with a different name or edit any one, delete or work with elements of the selected data container.

If you go into the editing of any data container, you can change its name or code, and the "Edit properties of this data container" button will also be available, after clicking which you can set the properties that will be in each element of the selected data container (for now they can be either html or a number, they can be a large number and they can be deleted to set new ones).

Having entered the selected "Data Containers", you can also click "Work with data container elements" where you can set new elements, delete or change, and change the properties of the selected element of the current data container .

Working with data containers in code

To work with data containers, the code implements the containerData class (gy/classes/containerData), which contains all the necessary methods (there is a description of the methods in the class file).

For example, you can get all types of properties of ContainerData:


Components for working with data containers are also implemented, they are called on the admin pages associated with data containers.

Below is an example of a component that displays test content (it is on the main one after installation and displays the data specified in the database for an example)):

 'containerdata_element_show', // name run component
 '0', // component template (0 - default)
  'container-data-code' => 'Content', // code of the counterparty of the data, where will the content come from
  'element-code' => 'html-index-page', // code of an element related to a given data container
  'cacheTime' => 86400 // cache time, cache for 24 hours

View documentation on