# How to "apply" controller on a navigation system

**URL:** <https://forum.getkirby.com/t/how-to-apply-controller-on-a-navigation-system/29359>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 24, 2023, 11:32am UTC](https://forum.getkirby.com/t/how-to-apply-controller-on-a-navigation-system/29359 "2023-08-24T11:32:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominique](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dominique/32/6631_2.png) [@Dominique](https://forum.getkirby.com/u/Dominique)\
**Post date:** [August 24, 2023, 11:32am UTC](https://forum.getkirby.com/t/how-to-apply-controller-on-a-navigation-system/29359/1 "2023-08-24T11:32:58Z")

</div>

OK, the title is weird, sorry for that.

On a snippet I create a navigation stuff using

```auto
<?php if ($page->hasPrev()) : ?>
    <span><?= $page->prev()->titre() ?></span>
...

```

There is a controller associated to the page, let’s name it `painting`. In this controller I computed a parameter named `titre`.  
Problem is I don’t have access to these `titre` data. The line involved is `$page->prev()->titre()` and it seem the `$page->prev()` have not the `painting` controller applied on it.  
I am pretty sure I am missing something really simple.

By the way, there is an error on the following cookbook’ page as the link to the [dedicated controller’s](https://getkirby.com/docs/reference/objects/kirby/controller) documentation leads to an error.

> **[Shared Controllers](https://getkirby.com/docs/cookbook/development-deployment/shared-controllers)**
>
> Share the content of a controller across multiple templates

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [August 24, 2023, 1:37pm UTC](https://forum.getkirby.com/t/how-to-apply-controller-on-a-navigation-system/29359/2 "2023-08-24T13:37:40Z")

</div>

In order to access the content of the `painting` controller I think you have to fetch it manually because it’s not automatically loaded.

I did not test it but you should be able to do something like this

`$kirby->controller('painting' , ['page' => $page->prev()]);`

This will return an array with all the data that’s returned by the `painting` controller

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 24, 2023, 3:54pm UTC](https://forum.getkirby.com/t/how-to-apply-controller-on-a-navigation-system/29359/3 "2023-08-24T15:54:04Z")

</div>

> [@Dominique](#):
>
> In this controller I computed a parameter named `titre`.

What do you mean by `parameter`? But you are using whatever you have defined as if it was a page method?

---

<div class="post-metadata">

**Author:** ![Dominique](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dominique/32/6631_2.png) [@Dominique](https://forum.getkirby.com/u/Dominique)\
**Post date:** [August 24, 2023, 4:59pm UTC](https://forum.getkirby.com/t/how-to-apply-controller-on-a-navigation-system/29359/4 "2023-08-24T16:59:49Z")

</div>

Thank you! Your answer put me on the right path!

😃

---

<div class="post-metadata">

**Author:** ![Dominique](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dominique/32/6631_2.png) [@Dominique](https://forum.getkirby.com/u/Dominique)\
**Post date:** [August 24, 2023, 5:00pm UTC](https://forum.getkirby.com/t/how-to-apply-controller-on-a-navigation-system/29359/5 "2023-08-24T17:00:53Z")

</div>

Hi,

Problem solved. Thank you !!!
