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

Cannot use attributes with dashes in them, like 'data-item' #4

Open
starrychloe opened this issue Apr 21, 2015 · 1 comment
Open

Cannot use attributes with dashes in them, like 'data-item' #4

starrychloe opened this issue Apr 21, 2015 · 1 comment

Comments

@starrychloe
Copy link

This doesn't work:

    .star-rating{title: $rating, data-url: $model->url}

Yields

syntax error, unexpected ':'
    <div <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'star-rating'), array('title', $rating), MtHaml\Runtime\AttributeList::create((data-url: $model->url))), 'html5', 'UTF-8'); ?>>

Neither does this:

    .star-rating{title: $rating, 'data-url': $model->url}

Yields

syntax error, unexpected ':'
    <div <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'star-rating'), array('title', $rating), MtHaml\Runtime\AttributeList::create(('data-url': $model->url))), 'html5', 'UTF-8'); ?>>
@starrychloe
Copy link
Author

Got this to work:

    .star-rating{:title => $rating, 'data-url' => $model->url}

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

No branches or pull requests

1 participant