Tour
Every Tour option, method, and component prop, with its default.
A Tour is a Driver.js walkthrough plus the two things UX Driver adds on top: a stable id and the once
flag. Every option below can be set in all three authoring forms.
Create
Component
<twig:Driver:Tour id="onboarding">
...
</twig:Driver:Tour>Twig builder
{% set tour = create_tour('onboarding') %}PHP builder
$tour = $tourBuilder->create('onboarding');TourBuilder is an autowired service — type-hint it in a controller and Symfony injects it. The id is
required, and it is the key once persists under.
Options
Builder methods carry the same name as the component prop. Bundle marks options UX Driver adds; everything else is passed through to Driver.js.
| Option or method | Type | Default |
|---|---|---|
showProgress / showProgress() | bool | bundle true; Driver.js default false |
animate / animate() | bool | true |
smoothScroll / smoothScroll() | bool | false |
allowClose / allowClose() | bool | true |
allowScroll / allowScroll() | bool | false |
allowKeyboardControl / allowKeyboardControl() | bool | true |
disableActiveInteraction / disableActiveInteraction() | bool | false |
duration / duration() | int ms | 500 |
overlayColor / overlayColor() | string | #000 |
overlayOpacity / overlayOpacity() | float | 0.7 |
overlayClickBehavior / overlayClickBehavior() | close or nextStep | close |
stagePadding / stagePadding() | int | 10 |
stageRadius / stageRadius() | int | 5 |
popoverClass / popoverClass() | string | none |
popoverOffset / popoverOffset() | int | 10 |
showButtons / showButtons() | list of next, previous, close | all |
disableButtons / disableButtons() | list of next, previous, close | none |
progressText / progressText() | string or trusted markup | {{current}} of {{total}} |
nextBtnText / nextBtnText() | string or trusted markup | Next → |
prevBtnText / prevBtnText() | string or trusted markup | ← Previous |
doneBtnText / doneBtnText() | string or trusted markup | Done |
once / once() Bundle | bool | false |
autostart Bundle | bool | false; component prop only |
The four text options are escaped before serialization — see Security — and a Step can override any of them for itself (Step reference).
Methods
| Method | Returns |
|---|---|
addStep() | $this, with the Step appended |
getSteps() | Serialized Driver.js steps |
getOptions() | Serialized Driver.js config |
isOnce() | The bundle persistence flag |
Twig functions
| Function | Renders |
|---|---|
create_tour(id) | A new Tour, for chaining in a template |
ux_tour(tour) | Controller attributes, always with autostart=false |
ux_tour_action(action, params) | data-action (and params) for the Tour controller |
ux_highlight(element, title, description, side, align, options) | A one-Step Tour for the highlight action |
ux_driver_html(html) | A string marked as trusted markup |
ux_highlight() has its own page: Highlights.
PHP services
| Service | Returns |
|---|---|
Pentiminax\UX\Driver\Builder\TourBuilder::create(id) | A new Tour, for chaining in PHP |
Pentiminax\UX\Driver\Builder\HintsBuilder::create(id) | A new Hints |
Both are autowired, so a controller or a service only has to type-hint them. create_tour() and
create_hints() are thin Twig wrappers over exactly these two calls.