Add Value Columns

In order to work with a database table, you need to tell CrudKit what columns in the database you’d like to work with.

  • CrudKit can only read, update and create data on columns that you specify. So, if you have an instance where you have a password column with hashed passwords, nobody can read or update the values of hashed passwords.
  • You will need to add all columns which have a NOT NULL constraint. This is required while creating rows on the table.

Function for adding a value column

You can use addColumn or addColumnWithId to add a column. Both functions do the same thing but with one important distinction: addColumnWithId will allow you to refer to a column by a unique ID. This is helpful when you don’t want to expose the column name to the client side. You might choose to do this for security considerations but it is not mandatory.

$sql_page->addColumn ($column_name, $column_label, $options);
// or 
$sql_page->addColumnWithId ($id, $column_name, $column_label, $options);

The parameters are: * id a unique ID for the column (if using addColumnWithId) * column_name the column name on your database table * column_label the human friendly label for your column to be used on forms * options an array of optional parameters.

The type of the column is automatically detected.

Optional parameters

Currently, no optional parameters are supported.

Built by Anirudh Sanjeev. CrudKit is distributed under the MIT/X11 License.