silverstripe /
silverstripe-taxonomy
| 1 | <?php |
||
| 2 | |||
| 3 | namespace SilverStripe\Taxonomy\Controllers; |
||
| 4 | |||
| 5 | use Page; |
||
|
0 ignored issues
–
show
|
|||
| 6 | use PageController; |
||
|
0 ignored issues
–
show
The type
PageController was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 7 | use SilverStripe\Control\HTTPRequest; |
||
| 8 | use SilverStripe\ORM\ArrayList; |
||
| 9 | use SilverStripe\View\ArrayData; |
||
| 10 | use SilverStripe\View\SSViewer; |
||
| 11 | |||
| 12 | if (!class_exists(PageController::class)) { |
||
| 13 | return; |
||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Class TaxonomyDirectoryController |
||
| 18 | * |
||
| 19 | * Controller for returning a list of pages tagged with a specific Taxonomy Term |
||
| 20 | */ |
||
| 21 | class TaxonomyDirectoryController extends PageController |
||
| 22 | { |
||
| 23 | |||
| 24 | private static $allowed_actions = array( |
||
|
0 ignored issues
–
show
|
|||
| 25 | 'index' |
||
| 26 | ); |
||
| 27 | |||
| 28 | public function index(HTTPRequest $request) |
||
| 29 | { |
||
| 30 | $termString = $request->param('ID'); |
||
| 31 | |||
| 32 | $pages = Page::get()->filter(['Terms.Name' => $termString]); |
||
| 33 | |||
| 34 | return $this->customise(new ArrayData(array( |
||
| 35 | 'Title' => $termString, |
||
| 36 | 'Term' => $termString, |
||
| 37 | 'Pages' => $pages, |
||
| 38 | 'Breadcrumbs' => $this->renderBreadcrumb($termString) |
||
| 39 | )))->renderWith(array(__CLASS__, "Page")); |
||
| 40 | } |
||
| 41 | |||
| 42 | protected function renderBreadcrumb($termString) |
||
| 43 | { |
||
| 44 | $page = new Page(); |
||
| 45 | $page->Title = $termString; |
||
| 46 | |||
| 47 | $template = new SSViewer('BreadcrumbsTemplate'); |
||
| 48 | return $template->process($this->customise(new ArrayData(array( |
||
| 49 | "Pages" => new ArrayList(array($page)) |
||
| 50 | )))); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths