4 ms·
Pakyow also uses logicless templates. It achieves this by having processors in ruby that you can bind to scopes/attributes. <div data-scope="users"><div data-
by toolz 11y ago
Pakyow also uses logicless templates. It achieves this by having processors in ruby that you can bind to scopes/attributes.
<div data-scope="users"><div data-attr="name"></div></div>
Now I have everything I need to process this html with my logic to turn it into
<div id="users">
<div id="user_1"> Frank </div>
<div id="user_2"> Bob </div>
</div>
https://pakyow.org/ https://pakyow.org/
edit: I wish downvotes required commenting on why you're downvoting.
- mst 11y agoI suspect it's because people regard the implied foreach loop of data-scope to not count as logicless. Personally I can see the arguments both ways, and have concluded that simply ensuring I'm using the same definition of logicless as the people I'm talking to is the best answer.
- toolz 11y agoAhh, well I never claimed it was logicless. I claimed the templates were logicless, and they are. The logic is kept separate inside the processors that you bind to the template.
- mst 11y agoExcept the -scope part means that the foreach-ness is indicated by the template, so people consider that to be not-logicless. I understood your claim fine. I'm trying to explain why it might be considered false (and I did already say I consider the arguments each way basically hair splitting).
- toolz 11y agoInteresting, I've never imagined an identifier could be labeled as logic. There is no need for a scope, if you mean that the outer identifier is logic. Anything could be the identifier and inside the processor you could define anything to be the outer layer. You could flip data-attr and data-scope just as easily, so I'm not sure where there could ever be an argument that those things represent logic rather than markup. Either way, I _think_ I have a better understand of potential conflicting views. Thanks for taking the time to explain.
- Can_Not 11y agoYour example actually looks like a namespace disaster about to happen with "id". Needs some prefixing and/or improved naming conventions. I'm not really how making your template have "less logic" than your example would produce a usable template language.