View/Add Template Variables for tpl files

  • | 3254 points

    Hi, While searching the tpl files I could identify 7 template variables...


    ...but I could not find one for the Project Name. For example, if I create a new project called 'foo-bar' and my Document Root is 'C:\Laragon\www' and my Hostname Format is {name}.localhost; Then <<HOSTNAME>> becomes foo-bar.localhost and <<PROJECT_DIR>> becomes C:/Laragon/www/foo-bar; but how would I get just 'foo-bar' as a variable, i.e. <<PROJECT_NAME>> equals 'foo-bar'?

    Specially my use case is that my production server (along with all my existing projects) are set up as {Document_Root}/{Client}/{Project}/public_html, So in the Apache tpl, I would like set

    define ROOT "<<DOC_ROOT>>/<<PROJECT_NAME>>/<<PROJECT_NAME>>/public_html"

    And while my immediate use case only needs to know what the PROJECT_NAME variable is. I do think, big picture, it would nice have the user be able to define custom variables as well. For example, I could set <<MY_PROJECT_DIR>> to already equal {Document_Root}/{name}/{name}/public_html, etc. So I could do

    define ROOT "<<MY_PROJECT_DIR>>"


Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.