Answer the question
In order to leave comments, you need to log in
Is there a library, class or other php solution?
Is there a library, class or other solution in php that allows you to create arbitrary entities (objects), any fields (characteristics) for them on the fly, generate forms and save the entered data for further processing?
In my subject area, there is a set of objects that changes periodically. New ones are added, old ones disappear. Each of the objects has a set (from 10 to 80) characteristics. It is necessary to give the user the ability to configure (enter and edit) their values (string, numeric, boolean, etc.), and then collect statistics on them (the history of the entered data: when and what value) and make some kind of reports. Because objects and their fields change quite often, it is necessary that a special user through the administrative interface can configure them without changing the source code. I note that we need not just the generation of forms, but the presentation of data in the form of entities (objects) with fields.
Drupal (fields, cck) solves this problem completely and completely, but I need a solution for an existing project, which is almost impossible to transfer to Drupal.
Judging by the results of the search in the PS, the task is either of little demand or there is a fundamentally different solution, which, alas, I have not found. Can anyone suggest options?
Answer the question
In order to leave comments, you need to log in
This can be solved on any framework + a couple of programmers, I don’t think there will be a ready-made solution, since “for an existing project, which is almost impossible to transfer to Drupal”. That is, you need a highly specialized solution. Also, everything described is similar to the EAV model.
ps: maybe there is a ready solution for eav ;)
Creating objects on the fly and assigning arbitrary fields to them is the basis of PHP basics, you don’t even need to set anything. Hint: Fields are best accessed through curly braces when it comes to custom fields. $object->{$field}.
And to save all this to the database - how to do it, in JSON it will all be perfectly stored in a document-oriented database.
Take any framework that has Scaffolding, it just allows you to create forms for any tables, as well as fill them in and delete information. Field extensions, etc. you will have to do it separately and finish this functionality on the same framework.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question