added functionality specified alias and tag
This commit is contained in:
parent
6da9d8a0bf
commit
1ab93e7e8a
|
|
@ -45,6 +45,20 @@ class SDT extends Text
|
|||
*/
|
||||
private $listItems = array();
|
||||
|
||||
/**
|
||||
* Alias
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $alias;
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $tag;
|
||||
|
||||
/**
|
||||
* Create new instance
|
||||
*
|
||||
|
|
@ -127,4 +141,36 @@ class SDT extends Text
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTag()
|
||||
{
|
||||
return $this->tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $tag
|
||||
*/
|
||||
public function setTag($tag)
|
||||
{
|
||||
$this->tag = $tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAlias()
|
||||
{
|
||||
return $this->alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $alias
|
||||
*/
|
||||
public function setAlias($alias)
|
||||
{
|
||||
$this->alias = $alias;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ class SDT extends Text
|
|||
}
|
||||
$type = $element->getType();
|
||||
$writeFormField = "write{$type}";
|
||||
$alias = $element->getAlias();
|
||||
$tag = $element->getTag();
|
||||
|
||||
$this->startElementP();
|
||||
|
||||
|
|
@ -50,6 +52,8 @@ class SDT extends Text
|
|||
|
||||
// Properties
|
||||
$xmlWriter->startElement('w:sdtPr');
|
||||
$xmlWriter->writeElementBlock('w:alias', 'w:val', $alias);
|
||||
$xmlWriter->writeElementBlock('w:tag', 'w:val', $tag);
|
||||
$xmlWriter->writeElementBlock('w:id', 'w:val', rand(100000000, 999999999));
|
||||
$xmlWriter->writeElementBlock('w:lock', 'w:val', 'sdtLocked');
|
||||
$this->$writeFormField($xmlWriter, $element);
|
||||
|
|
|
|||
Loading…
Reference in New Issue