# How to Configure PHPStorm for Kirby 3

**URL:** <https://forum.getkirby.com/t/how-to-configure-phpstorm-for-kirby-3/22950>\
**Category:** Questions\
**Tags:** v3\
**Created:** [July 21, 2021, 1:54am UTC](https://forum.getkirby.com/t/how-to-configure-phpstorm-for-kirby-3/22950 "2021-07-21T01:54:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirbyzone](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/kirbyzone/32/9224_2.png) [@kirbyzone](https://forum.getkirby.com/u/kirbyzone)\
**Post date:** [July 21, 2021, 1:54am UTC](https://forum.getkirby.com/t/how-to-configure-phpstorm-for-kirby-3/22950/1 "2021-07-21T01:54:09Z")

</div>

Hi all!

I’m trying out **[PHPStorm](https://www.jetbrains.com/phpstorm/)**, a specialised PHP IDE that is supposed to give us ‘superpowers’ and help us write better PHP code. Indeed, I can see it’s full of amazing features, but I can’t seem to find how to configure it to work well with the latest version of Kirby. How do I get it to recognise all the Kirby classes, and not complain that variables like `$page` and `$site` in my templates are ‘undefined’?

I’m using PHPStorm on a Mac, and I know we have some PHPStorm veterans here, so I’m hoping you might be able to guide us newbies…

---

<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:** [July 21, 2021, 5:08am UTC](https://forum.getkirby.com/t/how-to-configure-phpstorm-for-kirby-3/22950/2 "2021-07-21T05:08:49Z")

</div>

> **[PHP code typing with Kirby CMS](https://fvsch.com/kirby-typing)**
>
> Kirby 3 is built with PHP 7 and uses type annotations extensively, but this often won’t be reflected in an IDE. This post explores why, and what workarounds you can use.

---

<div class="post-metadata">

**Author:** ![kirbyzone](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/kirbyzone/32/9224_2.png) [@kirbyzone](https://forum.getkirby.com/u/kirbyzone)\
**Post date:** [July 21, 2021, 8:24am UTC](https://forum.getkirby.com/t/how-to-configure-phpstorm-for-kirby-3/22950/3 "2021-07-21T08:24:56Z")

</div>

Thank you for the link, @texnixe - really useful. Is this how _you_ use PHPStorm - that is, do you follow those conventions?

I’m noticing that using an IDE like this ‘prompts’ you to organise your code in a certain way - which is not a bad thing at all. Right now, I’m opening some old projects that had lots of computed Page properties declared in the Controller - rather than the Model - and, of course, following the guide above we’d have to use PHPDoc syntax at the template level for every one of those variables, in order for PHPStorm to recognise them. So, easier to move the code into the Model…

Next, I’d like to know if there is a way for us to customise the ‘link’ that PHPStorm tries to create when hovering over tokens - like:

 ![Screen Shot 2021-07-21 at 6.21.53 pm](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/9/9f338b1845f8ff51615c3d98b7d9675c7833e22e.png)

---

<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:** [July 21, 2021, 8:38am UTC](https://forum.getkirby.com/t/how-to-configure-phpstorm-for-kirby-3/22950/4 "2021-07-21T08:38:24Z")

</div>

> [@kirbyzone](#):
>
> Is this how _you_ use PHPStorm

Yes, but was easier to post the link then to explain in words 😉
