How to get Dreamweaver to display php gettext text?
Is there an extension or setting that would allow Dreamweaver to actually display "Hello World" when I type <?php echo _("Hello World"); ?>
?
Instead it just shows a "php" icon.
I mean, I usually blend HTML and PHP together, for example:
<strong>We found <?php echo $results;?> results!</strong>
That way in Dreamweaver I can easily see the general layout and static text of a page in design mode (Dreamweaver just replaces the php codes by php icons).
However, now I nee开发者_如何学编程d to use php 'gettext' for Internationalization. for that, I'll have to do:
<strong><?php echo _("We found");?> <?php echo $results;?> ...
So now my static text becomes php code in the eyes of Dreamwever, so it doesn't display anymore. I was wondering if there was any extension, or something else, that would make my job easier.
PHP is a server-side language meaning it has to go through a PHP interpreter in order for the output to be displayed, as far as I know Dreamweaver doesn't have a built-in interpreter so I doubt it's possible without further advanced configuration.
Unless it has some sort of extension for parsing the PHP, there is absolutely no possible way for you do do what you're asking.
The only way you'll be able to see the text is by actually running the site in your web server, or having the Dreamweaver project sit in the web server folder so that when you preview the page, it'll be parsed by PHP.
In short, there's no way, within the IDE, to parse and output the results of your PHP.
精彩评论