Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Views for custom media types are not compiled #616

Closed
morcmarc opened this Issue · 3 comments

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)
));

2) I created a few view files with .xml.php extension and a layout layouts/default.xml.php.

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

4) 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

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

@mehlah

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.