define constant does not work

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

define constant does not work

Postby loony » August 12th, 2017, 9:35 am

so I have an easy question.

In the php code of the shop there are a lot of constant who are defined.
My problem is now that the constant are not recogniced as a string

for example

Code: Select all
define('TemplatePath', 'some/path/to/the/template/');


If I gonna use it like
Code: Select all
TemplatePath . 'myTemplateFolder'
the URL would look like that
Code: Select all
TemplatePathmyTemplateFolder
instead of
Code: Select all
some/path/to/the/template/myTemplateFolder


Im using the latest version of VS 12 Professional and the latest version from PHPTools

Where is my problem? :D
loony
 
Posts: 1
Joined: August 12th, 2017, 9:23 am

Re: define constant does not work

Postby maros.beno » August 17th, 2017, 9:15 am

Hi, I tried to do:
Code: Select all
<?php
define('TemplatePath', 'some/path/to/the/template/');
echo TemplatePath . 'myTemplateFolder';

and it works perfectly fine. PHP Tools only uses official PHP. If your output is different than
some/path/to/the/template/myTemplateFolder
, you don't have this constant defined before evaluation and then the output would be like yours
Code: Select all
TemplatePathmyTemplateFolder
Maroš Beňo
User avatar
maros.beno
 
Posts: 62
Joined: October 12th, 2016, 12:11 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron

User Control Panel

Login

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 151 on December 6th, 2020, 7:46 am

Users browsing this forum: No registered users and 1 guest