# Wie kann mann pfad von plugin in ein controller erfinden?

**URL:** <https://forum.shopware.com/t/wie-kann-mann-pfad-von-plugin-in-ein-controller-erfinden/47966>\
**Category:** Programmierung\
**Created:** [31. August 2017 um 14:06 UTC](https://forum.shopware.com/t/wie-kann-mann-pfad-von-plugin-in-ein-controller-erfinden/47966 "2017-08-31T14:06:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flynorc](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@flynorc](https://forum.shopware.com/u/flynorc)\
**Post date:** [31. August 2017 um 14:06 UTC](https://forum.shopware.com/t/wie-kann-mann-pfad-von-plugin-in-ein-controller-erfinden/47966/1 "2017-08-31T14:06:43Z")

</div>

Hallo,

Ich suche eine bessere methode für absolute pfad zum plugin root als

```
$path = __DIR__. DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR;

$path = __DIR__. "/../../";

```

Ich suche einfach “base” pfad zum plugin, und Controller ist 2 ordner tiefer, deswegen muss ich zwei nivos höher gehen.

Ich könnte auch so was benutzen, aber das ist mehr für pfad von änderen plugins zu finden, nicht für pfad der Plugin der controller gehört, oder?

```
// Beispiel dass den Pad zu den Views eines Plugins ermittelt
$plugin = Shopware()->Container()->get('kernel')->getPlugins()['PluginName'];
$viewPath = $plugin->getPath() . '/Views';

```

irgendwas wie $this-\>getPath(); soll das sein aber ich finde es nicht.

&nbsp;

Vielen dank!

&nbsp;

---

<div class="post-metadata">

**Author:** ![arnebecker](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@arnebecker](https://forum.shopware.com/u/arnebecker)\
**Post date:** [1. September 2017 um 09:41 UTC](https://forum.shopware.com/t/wie-kann-mann-pfad-von-plugin-in-ein-controller-erfinden/47966/2 "2017-09-01T09:41:03Z")

</div>

Mehr als die beiden Möglichkeiten fallen mir auch nicht ein.
