dev-master
9999999-devTakes form field descriptions through $db_descriptions and shows them in the edit form.
BSD-3-Clause
The Requires
model silverstripe fields descriptions
Takes form field descriptions through $db_descriptions and shows them in the edit form.
Takes form field descriptions through $db_descriptions and shows them in the edit form., (*1)
composer require "svandragt/silverstripe-description:*"
Object::add_extension("DataObject","DescriptionDataExtension");
Course.php:, (*2)
<?php class Course extends DataObject { public static $db = array( 'Title' => 'Varchar(500)', 'IPPCode' => 'Varchar(20)', ); public static $db_descriptions = array( 'IPPCode' => 'Lookup to existing IPP Code if available', ); }
CourseModelAdmin.php:, (*3)
<?php class CourseModelAdmin extends ModelAdmin { public static $managed_models = array( 'Course', ); static $url_segment = 'courses'; // Linked as /admin/products/ static $menu_title = 'Course Admin'; }
Do a /dev/build and create a new course in the CMS. You will see the IPPCode field has a description below it., (*4)
, (*5)
Takes form field descriptions through $db_descriptions and shows them in the edit form.
BSD-3-Clause
model silverstripe fields descriptions