Code: Select all
<?php
$data = array(
'tracks' => array(
'fields' => array('control_no', 'track_name', 'track_length', // will be used to create the form, names & id values
'alias', 'area', 'province', 'country',
'contact_name', 'contact_number', 'email_address',
'web_address', 'track_map', 'directions', 'web_page',
),
'tooltips' => array('Control number', 'Track name', 'Track length (in meters)', // tool tips for each field
'Known as', 'Track area', 'Track province',
'Track country', 'Contact person', 'Contact number',
'Email address', 'Web address', 'Track map',
'Directions', 'Web page',
),
// fields for specific table here
),
// etc
?>I don't want to re-create this array in each of the classes but i'm not sure how to go about making it available to all 3 classes. Defining it as a constant doesn't work, something about scalar values the error message said so i'm thinking of creating a "base" class from which these 3 classes would extend and thus making the property available to all child classes. Is my approach valid or should i take a different route?