Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 601 Bytes

README.md

File metadata and controls

34 lines (27 loc) · 601 Bytes

Symfony 5 Web starter

<?php
class GO_Example_Model_Thing extends GO_Base_Db_ActiveRecord {
<!--HTML from anywhere-->
<div data-controller="hello">
  <input data-hello-target="name" type="text">

  <button data-action="click->hello#greet">
    Greet
  </button>

  <span data-hello-target="output">
  </span>
</div>
// hello_controller.js
import { Controller } from "stimulus"

export default class extends Controller {
  static targets = [ "name", "output" ]

  greet() {
    this.outputTarget.textContent =
      `Hello, ${this.nameTarget.value}!`
  }
}