BasePath and BaseUrl in config

Notice: This thread is very old.
kedrigern
Member | 102
+
0
-

Hi,

how I can get basePath and baseUrl in config or from di\container in Nette 2.1.*?

I have model that needs basePath and baseUrl.

Last edited by kedrigern (2014-03-29 21:15)

kedrigern
Member | 102
+
0
-

I found that \Nette\DI\Container can provide:

  • appDir: $container->getParameters()[‘appDir’]
  • wwwDir: $container->getParameters()[‘wwwDir’]
  • tempDir: $container->getParameters()[‘tempDir’]

BaseUrl is not so important, but stil – is there any way?

Mariocz
Member | 52
+
0
-

you should pass these parameters in config

don't see any basepath param. Inicialization of these three params: https://api.nette.org/…tor.php.html#…

services:
	-
		class: App\Model\ImageStorage
		arguments: [%wwwDir%/images/uploads]
Jan Suchánek
Member | 404
+
0
-

@kedrigern:

or you can add to service complete httpRequest in constructor Nette\Http\Request.

and more in Jak se dostat v presenteru k proměnným wwwDir nebo appDir

Last edited by jenicek (2014-03-29 23:10)