]> _ Git - cubist_cms-back.git/commitdiff
wip #5027
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jan 2022 15:21:22 +0000 (16:21 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jan 2022 15:21:22 +0000 (16:21 +0100)
src/app/Magic/Fields/Field.php

index a098b1bbd601be85c044e72661dd5ccce4f4bce6..689767dfe536feb59645950f162f97d0ce64877e 100644 (file)
@@ -34,6 +34,7 @@ class Field implements \ArrayAccess
     protected $_suffix = null;
 
     protected $_placeholder = null;
+    protected $_pattern = null;
 
     protected $_adminType = 'text';
     protected $_viewNamespace = 'crud::fields';
@@ -151,7 +152,7 @@ class Field implements \ArrayAccess
             'can' => $this->_can, 'can_write' => $this->_canWrite, 'auth' => $this->_auth,
             'database_type' => $this->_databaseType, 'database_unique' => $this->_databaseUnique, 'database_index' => $this->_databaseIndex, 'database_default' => $this->_databaseDefault, 'database_length' => $this->_databaseLength,
             'fake' => false, 'store_in' => 'extras', 'attributes' => [],
-            'placeholder' => $this->_placeholder,
+            'placeholder' => $this->_placeholder, 'pattern' => $this->_pattern,
         ];
     }
 
@@ -195,7 +196,7 @@ class Field implements \ArrayAccess
     {
         $res = [];
 
-        $fieldAttributes = ['placeholder', 'rows'];
+        $fieldAttributes = ['placeholder', 'rows', 'pattern'];
 
         foreach ($this->_attributes as $k => $v) {
             if (null === $v) {