Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to pass variables into lessphp filter #177

Merged
merged 3 commits into from
Apr 4, 2012

Conversation

kastaneda
Copy link
Contributor

This is a very simple enhancement that lets pass variables into the less file from php (using the already existing functionality):
http://leafo.net/lessphp/docs/#setting_variables_from_php

I also concerned about the ability to set these variables from config.yml, this requires appropriate changes in AsseticBundle.

I suppose an example to call lessphp:

assetic:
    filters:
        lessphp:
            presets:
                baseColor:      '#f00'
                anotherColor:   '#0f0'
                imagePrefix:    'http://cdn.example.com/img/'

*
* @param array $presets An array of pre-defined variables
*/
public function __construct(array $presets = array())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most filters use setters for the options instead of constructor arguments

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should be a setter.

@stof
Copy link
Collaborator

stof commented Feb 28, 2012

@kastaneda can you update your code to inject the variables through a setter instead ?
And please also add a test for this feature

@stof
Copy link
Collaborator

stof commented Apr 3, 2012

@kastaneda ping

stof added a commit that referenced this pull request Apr 4, 2012
Ability to pass variables into lessphp filter
@stof stof merged commit 22f8cbe into kriswallsmith:master Apr 4, 2012
stof added a commit that referenced this pull request Apr 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants