custom fields have been added to the documents

This commit is contained in:
iIronside
2022-12-09 16:18:57 +03:00
parent aad1b14473
commit 5b455b59f9
25 changed files with 904 additions and 106 deletions

View File

@@ -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];
}
}