Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/attitude/riotphp-tags
[Experimental] Riot.js templetes to PHP transformation
https://github.com/attitude/riotphp-tags
Last synced: about 6 hours ago
JSON representation
[Experimental] Riot.js templetes to PHP transformation
- Host: GitHub
- URL: https://github.com/attitude/riotphp-tags
- Owner: attitude
- License: mit
- Created: 2015-12-10T11:12:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-12T14:30:36.000Z (almost 9 years ago)
- Last Synced: 2023-03-11T07:18:33.913Z (over 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Riot PHP Tags
[Experimental] [Riot.js](https://github.com/riot/riot) templates to PHP transformation### Supported features
- [x] Quotes are optional: `` becomes ``.
- [x] Without the `` tag the JavaScript starts where the last HTML tag ends
- [x] Tag styling (extracted)
- [x] Scoped CSS
- [ ] Nested tags
- [ ] Options
- [ ] Yeld
- [ ] Mixins
- [ ] Expressions
- [x] `{ var }` becomes `<?=$var?>`
- [x] `{ a() }` becomes `<?=a()?>` (maybe should become `<?=$this['a']()?>` or `<?=$a()?>`)
- [x] `{ var.value }` becomes `<?=$var['value']?>`
- [ ] `{ title || 'Untitled' }`
- [ ] `{ results ? 'ready' : 'loading' }`
- [ ] `{ new Date() }`
- [ ] `{ message.length > 140 && 'Message is too long' }`
- [ ] `{ Math.round(rating) }`
- [ ] Boolean attributes (checked, selected etc..)
- [ ] `<input checked={ null }>` becomes `<input>`
- [ ] 44 different boolean attributes
- [ ] Class shorthand:
- [ ] `class={ completed: done }` becomes `class="completed"` when the value of done is a true value
- [ ] `<p class={ foo: true, bar: 0, baz: new Date(), zorro: 'a value' }></p>` evaluates to `<p class="foo baz zorro"></p>`
- [ ] Printing brackets
- [x] Customizing curly braces
- [x] Custom tags can be empty, HTML only or JavaScript only
- [x] Conditionals
- [x] `if={ ... }`
- [x] `show={ ... }`
- [x] `hide={ ... }`
- [x] Loops
- [ ] `each="{ items }"`
- [x] `each="{ name, i in arr }"`
- [x] `each="{ name, value in obj }"
- [ ] `no-reorder` attr support
- [ ] `parent.` context
- [ ] Pass the item as an option to the looped tag with `data={ ... }`
- [ ] VIRTUAL tag
- [ ] HTML elements as tags
- [ ] `<ul riot-tag="my-tag"></ul>`
- [ ] Server-side rendering### Notes
- Pre-processors should be handled by a separate tool
- Complex expressions would require tokenization
- `{ title || 'Undefined' }` or `{ title && 'Defined' }` does not behave as in JavaScript