CakePdf\Pdf\CakePdf::layoutPath PHP Метод

layoutPath() публичный Метод

Layout path
public layoutPath ( mixed $layoutPath = false ) : mixed
$layoutPath mixed The path of the layout file to use
Результат mixed
    public function layoutPath($layoutPath = false)
    {
        if ($layoutPath === false) {
            return $this->_layoutPath;
        }
        $this->_layoutPath = $layoutPath;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Test the custom paths for Layouts
  *
  * @dataProvider provider
  */
 public function testCustomLayoutPaths($config)
 {
     $pdf = new CakePdf($config);
     $pdf->viewVars(['data' => 'testing']);
     $pdf->template('testing', 'pdf');
     $pdf->layoutPath('customPath');
     $result = $pdf->output();
     $expected = 'CustomLayoutData: testing';
     $this->assertEquals($expected, $result);
 }