mirror of
https://github.com/processwire/processwire.git
synced 2025-08-25 23:56:41 +02:00
Add support for Fieldtypes to specify that a Field should use a custom class that extends the Field class, rather than always using the "Field" class.
This commit is contained in:
@@ -199,6 +199,21 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule {
|
||||
$initFields[$className] = 1;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get class name to use Field objects of this type (must be class that extends Field class)
|
||||
*
|
||||
* Return blank if default class (Field) should be used.
|
||||
*
|
||||
* @param array $a Field data from DB (if needed)
|
||||
* @return string Return class name or blank to use default Field class
|
||||
* @since 3.0.147
|
||||
*
|
||||
*/
|
||||
public function getFieldClass(array $a = array()) {
|
||||
require_once(dirname(__FILE__) . '/RepeaterField.php');
|
||||
return 'RepeaterField';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class used for repeater Page objects
|
||||
|
@@ -0,0 +1,5 @@
|
||||
<?php namespace ProcessWire;
|
||||
|
||||
class RepeaterField extends Field {
|
||||
// example of custom class for Field object (not yet put to use in this case)
|
||||
}
|
Reference in New Issue
Block a user