PhpGt / Turbo

Instant pages, a micro-framework for the client-side
0 stars 0 forks source link

Basic docs #2

Open g105b opened 1 year ago

g105b commented 1 year ago

A description of how to use this, and what's to come when it's released.

g105b commented 1 year ago

data-turbo on any element, then any same-site links in or under that element will be added to the turbo click cache.

When added to a <form>, data-turbo="&" will update only itself, or if other areas are required, data-turbo="&,article>output" can indicate what selectors to output.

go()

Also, data-turbo="go(chart)" will only execute the go_chart function in webengine (by sending the x-go: chart header.

Different go functions can be tagged with DocumentScope("article>output .chart") attributes, which are sent back down the Response, which indicate which HTML selectors to update by turbo.js.

This ties in with the MPA documentation section in WebEngine docs.