2014-04-24 14:58:15 +07:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* PHPWord
|
|
|
|
|
*
|
|
|
|
|
* @link https://github.com/PHPOffice/PHPWord
|
|
|
|
|
* @copyright 2014 PHPWord
|
2014-05-04 17:55:54 +07:00
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPL
|
2014-04-24 14:58:15 +07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace PhpOffice\PhpWord\Writer\HTML\Style;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Paragraph style HTML writer
|
|
|
|
|
*
|
|
|
|
|
* @since 0.10.0
|
|
|
|
|
*/
|
2014-04-26 11:14:27 +07:00
|
|
|
class Paragraph extends AbstractStyle
|
2014-04-24 14:58:15 +07:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Write style
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function write()
|
|
|
|
|
{
|
2014-05-01 14:37:58 +07:00
|
|
|
if (!($this->style instanceof \PhpOffice\PhpWord\Style\Paragraph)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-24 14:58:15 +07:00
|
|
|
$css = array();
|
|
|
|
|
if ($this->style->getAlign()) {
|
|
|
|
|
$css['text-align'] = $this->style->getAlign();
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-26 11:14:27 +07:00
|
|
|
return $this->assembleCss($css);
|
2014-04-24 14:58:15 +07:00
|
|
|
}
|
|
|
|
|
}
|