PHPRtfLite::setBorders PHP Method

setBorders() public method

Sets borders to rtf document. Sections may override this border.
public setBorders ( PHPRtfLite_Border_Format $borderFormat, boolean $left = true, boolean $top = true, boolean $right = true, boolean $bottom = true )
$borderFormat PHPRtfLite_Border_Format
$left boolean
$top boolean
$right boolean
$bottom boolean
    public function setBorders(PHPRtfLite_Border_Format $borderFormat, $left = true, $top = true, $right = true, $bottom = true)
    {
        if ($this->_border === null) {
            $this->_border = new PHPRtfLite_Border($this);
        }
        $this->_border->setBorders($borderFormat, $left, $top, $right, $bottom);
    }

Usage Example

示例#1
0
 /**
  * tests setBorders
  * @covers PHPRtfLite::getBorder
  */
 public function testSetBorders()
 {
     $borderFormat = new PHPRtfLite_Border_Format();
     $this->_rtf->setBorders($borderFormat);
     $border = $this->_rtf->getBorder();
     if ($border) {
         $this->assertEquals($borderFormat, $border->getBorderBottom());
         $this->assertEquals($borderFormat, $border->getBorderTop());
         $this->assertEquals($borderFormat, $border->getBorderLeft());
         $this->assertEquals($borderFormat, $border->getBorderRight());
         return;
     }
     $this->fail();
 }