开发者

Fatal error: Class 'Products\Summary\Html\Section' not found

开发者 https://www.devze.com 2023-02-19 06:44 出处:网络
Fatal error: Class \'Products\\Summary\\Html\\Section\' not found I get the above error on the following code.I\'ve verified that Summary\\Html\\Section() is indeed the namespace of the class I\'m t
Fatal error: Class 'Products\Summary\Html\Section' not found

I get the above error on the following code. I've verified that Summary\Html\Section() is indeed the namespace of the class I'm trying to access. I'm not entirely sure why this isn't working... any thoughts?

<?php

namespace Products;

use Products\Base as ProductBase;
use Products\Mapping as MappingInterface;
use Summary\Html;

class Product1 extends ProductBase implements MappingInterface {
    /**
     * Complete PDF mapping
     *
     * @return Array
     */
    public function render() {
        $preTable = new Summary\Html\Section();
        $row = $preTable->addRow();

        $row->addColumn()->setValue('Headline one')->addClass(开发者_如何学运维'first'); 
        $row->addColumn()->setValue('Headline two')->addClass('first');

        return $preTable;
    }

My section class:

namespace Summary\Html;

use Summary\Html\Element;


use Summary\Html\Section\Row;

class Section extends Element {


Looks like it thinks Summary\Html is part of the Products namespace. Try this:

$preTable = new \Summary\Html\Section();

0

精彩评论

暂无评论...
验证码 换一张
取 消