public function __construct($name, $data, $options = array()) { // Add a few more reserved attributes for relation fieldtypes array_push($this->reserved, 'relation', 'related', 'title'); // Make sure the related model is initialized if (isset($options['related']) && !$options['related'] instanceof Model) { $options['related'] = new Model($options['related']); } parent::__construct($name, $data, $options); }
public function __construct($name, $data, $options = array()) { parent::__construct($name, $data, $options); // add a class for javascript to attach $this->attributes['class'][] = 'pt-colorpicker'; }
public function __construct($name, $data, $options = array()) { // Add another reserved attribute for file fieldtype array_push($this->reserved, 'directory'); parent::__construct($name, $data, $options); }