Skip to content

Instantly share code, notes, and snippets.

@vojtasvoboda
Created January 4, 2016 10:40
Show Gist options
  • Save vojtasvoboda/0f8a3fa73a4281dbf661 to your computer and use it in GitHub Desktop.
Save vojtasvoboda/0f8a3fa73a4281dbf661 to your computer and use it in GitHub Desktop.
Extending YAML and model class in OctoberCMS
<?php
// ...
public function boot()
{
UserModel::extend(function($model) {
$model->addFillable([
'phone',
'mobile',
'company',
'street_addr',
'city',
'zip'
]);
$model->implement[] = 'RainLab.Location.Behaviors.LocationModel';
});
UsersController::extendFormFields(function($widget) {
$configFile = __DIR__ . '/config/profile_fields.yaml';
$config = Yaml::parse(File::get($configFile));
$widget->addTabFields($config);
});
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment