Models - form

This example shows how to create input forms from models and how to store the posted form data.

This example requires a MySQL or PostgreSQL database engine.

Where to find the example

This example is included inside the Artaengine package. You can find it in this directory:


download Artaengine package

Deploy and run the example

  • Create a new database in PostgreSQL or MySQL and name it arta_examples. All Artaengine examples are set to use this database.
  • Download the Artaengine package
  • Extract into your "www" directory.
  • It is recommended to create a virtual host for /www/artaengine/examples
  • Find this example in /www/artaengine/examples/example7 enter the directory and follow:
  • Edit the /configure.ini and update the settings to your local. Make sure the database connection configs match with the database you created for the example(s).
  • Edit /factories/Example.php and edit the Example.connection() method, there is an example of a manual connection to a database (the connection configs are set inside the source code not the config.ini) change the connection configs to your database.
  • Set permissions. Artaengine requires write permissions to the /_temp directory.
  • Build the example e.g. (http://artaexamples.local/example7/build)
  • If build shows errors:
    • Check directory permissions
    • Empty temp directory
    • Check if "/start.php" and "/configure.ini" have correct paths and settings
    • Check the database and model settings

Deploying with Artaengine project administrator

Alternatively you can deploy the examples via the Artaengine project administrator GUI

After deploying the Artaengine project administrator, goto the Existing menu and search for the examples. Add the examples to the administrator the goto the Update menu and manage the example you want.

Related Tutorials

Data modeling - form

Data modeling - principle

Data modeling - creating models

Data modeling - using models