-1

Symfony is an excellent platform but i am unable to resolve its Path issue . in some cases i need to get full path of src folder i have tried every possible path generator or locator they all return either app/ directory path or web directory path as rootpath or basepath kindly someone help me if i am missing some thing e.g

 $dst    = dirname("Resources/public/pkpass/");

and

 $dst    = __DIR__.'/../../src'."/Resources/public/pkpass";

and

$this->get('kernel')->getRootDir()."/Resources/public/pkpass";

and

$this->getRequest()->getBasePath()."/Resources/public/pkpass"; etc

and for the record i am trying to get and use the path in rest api

numerah
  • 498
  • 7
  • 29
  • I've already made a similar answer on your own question. Please, consider [reading it again](http://stackoverflow.com/a/21598149/1607098) – Touki May 27 '14 at 07:30

2 Answers2

2

Try this

$this->get('kernel')->getRootDir() . "/../src";
Tomasz Madeyski
  • 10,742
  • 3
  • 50
  • 62
  • i am trying to do this in api and i tried that it is giving me this /var/www/html/apppassbook/app/../src because no html content is working i have to give full path which shouldn't use html for its processing – numerah May 27 '14 at 07:37
  • hmm, I don't get it. Do you need absolute path to src folder on your disk? If so, path /var/www/html/apppassbook/app/../src is 100% ok. If you want web path this is something completely different – Tomasz Madeyski May 27 '14 at 09:20
-3

I do not know what it is you need, but you can create a service and call

$this->get('service')->get('resource')

  • 1
    What does this explain? Can you give additionnal informations? It seems completely unrelated to the question. – Touki May 27 '14 at 07:43
  • I mean can create a service for obtaining different addresses for use. http://symfony.com/doc/current/book/service_container.html – Harut Grigoryan May 27 '14 at 08:06