Issues

ZF-6079: phtml not being processed by php

Issue Type: Bug Created: 2009-03-21T05:49:22.000+0000 Last Updated: 2009-04-06T14:26:05.000+0000 Status: Resolved Fix version(s): Reporter: Marcus Schumann (tanax) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: Related issues: Attachments: - zenderr1.JPG

Description

Hi! I'm using WAMP server on localhost.

My folder structure looks like this: c:/wamp <- my web root (similar to quick start in the quick guide) c:/wamp/application <- contains models, controllers and views c:/wamp/library <- zend framework c:/wamp/www <- the public folder

So the issue here.. everything works great. I can access controllers and actions by changing the URL, and it will find the correct view-file. The view-files looks great.. except when I start adding PHP content in it. The PHP doesn't get processed by the server for some reason. This is only in the .phtml files, because since the index.php file works, and the bootstrap, and the respectivly controller classes. All of those works with PHP.. except the .phtml files.

The actual PHP content in .phtml files doesn't get printed on the page, however, it's visible in the sourcecode of the page(almost like an HTML comment). In the screenshots I'm providing I'm using shorttags, however, I've tried it with regular PHP tags aswell, and it doesn't work either. I've also tried editing the httpd.conf for apache and adding the application type .phtml for php applications, however the problem still persists.

Is this a bug? Even if it's not a bug in the actual framework - how can I solve it? Thanks in advance!

Comments

Posted by Marcus Schumann (tanax) on 2009-03-21T05:54:04.000+0000

Screenshot 1. This is the view in the browser.

Posted by Marcus Schumann (tanax) on 2009-03-21T05:55:23.000+0000

This is the view of the sourcecode of the page in the browser.

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-03-21T06:16:42.000+0000

Try to remove the space in test to: test If that dcoesn't work, either enable shorttags, or go for the full syntax (: test; ?>)

Posted by Marcus Schumann (tanax) on 2009-03-21T06:33:25.000+0000

Quote: In the screenshots I'm providing I'm using shorttags, however, I've tried it with regular PHP tags aswell, and it doesn't work either.

I've tried full syntax, and it doesn't work.. :/

Posted by Ender (ender) on 2009-04-06T12:40:41.000+0000

Also using WAMP, same issue. Tried Dolf's suggestion. Worked for me. But a little disappointing and made the Quickstart, not very Quick.

By the way there are a instances of "env): ?>
which does not follow the ZF coding standards. B.4.1. PHP Code Demarcation, "Short tags are never allowed."

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-04-06T12:44:03.000+0000

By default shorttags is/are turned on afaik, so if WAMP deviates from that, you should complain with them.

Secondly, the coding standards are (again, afaik) only applicable to ZF code itself, not to views.

Posted by Marcus Schumann (tanax) on 2009-04-06T14:18:50.000+0000

Well I still don't get it to work. I've turned OFF shorttags, and using the full syntax, but I still get the "" in the view.

And as I said before, PHP IS working, otherwise I wouldn't even be able to see the page cause the reroute from index.php wouldn't work..

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-04-06T14:26:05.000+0000

Maybe you need to add phtml to your extension thing in your php config. But once again; this has got nothing to do with what the issue was originally about. If you believe this is a bug, add a new issue, or look at the appropriate places for support.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts