Issues (686)

examples/pagination-component/code.php (1 issue)

Labels
Severity
1
<?php
2
3
use Jaxon\App\PageComponent;
4
5
class PageContent extends PageComponent
6
{
7
   /**
8
    * @inheritDoc
9
    */
10
    protected function limit(): int
11
    {
12
        return 10;
13
    }
14
15
   /**
16
    * @inheritDoc
17
    */
18
    protected function count(): int
19
    {
20
        return 150;
21
    }
22
23
    public function html():  string
24
    {
25
        return '<div style="margin-bottom:10px;font-weight:bold;">' .
26
            $this->stash()->get('title') .
27
            '</div>Showing page number ' . $this->currentPage();
28
    }
29
30
    public function showPage(int $pageNumber, string $title)
31
    {
32
        $this->stash()->set('title', $title);
33
34
        // Get the paginator. This will also set the final page number value.
35
        $paginator = $this->paginator($pageNumber);
36
        // Render the page content.
37
        $this->render();
38
        // Render the pagination component.
39
        $paginator->render($this->rq()->showPage(je()->rd()->page(), $title));
0 ignored issues
show
The method showPage() does not exist on Jaxon\Script\Call\JxnCall. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
        $paginator->render($this->rq()->/** @scrutinizer ignore-call */ showPage(je()->rd()->page(), $title));
Loading history...
40
    }
41
}
42
43
jaxon()->app()->setup(configFile('component.php'));
44