Question

I'm having some trouble with understanding the meaning of this snippet. I know that __ DIR __ refers to my absolute path, in my case /Applications/MAMP/htdocs

__ DIR __.'/../app'

Where is this path looking for the folder /app?

thx,

Était-ce utile?

La solution

This path means:

/Applications/MAMP/app

.. is the directory above. So he enters htdocs, enters the parentdirectory (which is MAMP) and then the directory app.

And for the knowledge: Should you ever see ., this means current directory. For example:

C:/Users/Admin/.

means exactly:

C:/Users/Admin/.

.. would mean:

C:/Users/

Autres conseils

This is looking for /app under /Applications/MAMP/

__ DIR __.'/../app'
____________^

That's because you have the .. which means parent directory.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top