custom fields have been added to the documents
This commit is contained in:
@@ -18,6 +18,8 @@ use yii\db\Expression;
|
||||
*/
|
||||
class DocumentTemplate extends \yii\db\ActiveRecord
|
||||
{
|
||||
private $fieldPattern = '/\${(№?\s*\w*|(\w*\s?)*)}/';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -66,4 +68,10 @@ class DocumentTemplate extends \yii\db\ActiveRecord
|
||||
'updated_at' => 'Updated At',
|
||||
];
|
||||
}
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
preg_match_all($this->fieldPattern, $this->template_body,$out);
|
||||
return $out[0];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user