Jump to content

PW changes the output of external php class


Roope
 Share

Recommended Posts

Hi all!

I came across to strange issue today. I was testing the oyejorges Less.php class to parse my less assets and noticed that when I use it on PW template the output of class changes. When you use less percentage() function, on PW decimal mark changes from point to comma.

I've been using oyejorges Less.php class for some time now on different php apps and haven't noticed this kind of behaviour before. I'm totally lost here - where is it comming from and is it because of PW or Less.php? Any help is much appreciated!

https://github.com/oyejorge/less.php/search?q=percentage&ref=cmdform

https://github.com/oyejorge/less.php/search?q=Less_Tree_Dimension&ref=cmdform

My RTC details - code on php file outside PW and on PW template.

template:

<?php 

require 'site/modules/less/Less.php';   // test.php
require '../modules/less/Less.php';     // site/templates/home.php

$less = new Less_Parser();

$less->parse(" div { value: percentage(12.3 / 14.5); } ");

echo $less->getCss();

?>

output:

div { value: 84.82758620689656%; }   // test.php
div { value: 84,82758620689656%; }   // site/templates/home.php
Link to comment
Share on other sites

Thanks Wanze! Lighting fast response and perfect answer!

This is multilingual site and I had finnish language by default for admin user so change back to english corrected output. You rock!

But now this leads to another question. I don't want my css output change for user language. It has to be same all the time or it's not valid. How can I prevent this change?

EDIT: ..or that makes me wonder isn't this more of a issue at oyejorges less class since it should worry about generating valid css and not to rely on any php locale settings..

Edited by Roope
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...