Views for custom media types are not compiled #616

Closed
morcmarc opened this Issue Aug 22, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@morcmarc
  1. I created an XML media type in media.php
Media::type('xml', array('application/xml'), array(
    'view' => 'lithium\template\View',
    'paths' => array(
        'template' => array(
            '{:library}/views/{:controller}/{:template}.xml.php'
        ),
        'layout' => '{:library}/views/layouts/default.xml.php'
    ),
    'conditions' => array('xml' => true)
));
  1. I created a few view files with .xml.php extension and a layout layouts/default.xml.php.

  2. When I run my code on PHP 5.4.4 on Windows everything behaves as expected.

  3. When I run my code on Ubuntu 12.04, PHP 5.3.10ubuntu3.2 with Suhosin-Patch the <?= tags are not escaped. If I have my short tags turned on in the php.ini I get an error message.

Note: html media types are escaped properly, it affects the xml files only.

@morcmarc

This comment has been minimized.

Show comment Hide comment
@morcmarc

morcmarc Aug 22, 2012

Correction: it seems I managed to break .html.php files as well by turning the short open tags off.

Correction: it seems I managed to break .html.php files as well by turning the short open tags off.

@mehlah

This comment has been minimized.

Show comment Hide comment
@mehlah

mehlah Aug 22, 2012

Contributor

Double check that your resources/tmp/cache/templates directory exists and is writable (chmod -R 777 resources/).
Lithium parse <?= tags, render and compile templates files and write them to this directory.

Contributor

mehlah commented Aug 22, 2012

Double check that your resources/tmp/cache/templates directory exists and is writable (chmod -R 777 resources/).
Lithium parse <?= tags, render and compile templates files and write them to this directory.

@morcmarc

This comment has been minimized.

Show comment Hide comment
@morcmarc

morcmarc Aug 22, 2012

Yep, it solved the problem, even though I'm not sure why I didn't get an error message about the problem (I have logging and display errors turned on).

Yep, it solved the problem, even though I'm not sure why I didn't get an error message about the problem (I have logging and display errors turned on).

@morcmarc morcmarc closed this Aug 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment