jaxon-php /
jaxon-mono
| 1 | <?php $this->extends('templates::examples/layout.php') ?> |
||||
| 2 | |||||
| 3 | <?php |
||||
| 4 | use App\Test\Test as AppTest; |
||||
| 5 | use App\Test\Buttons as AppButtons; |
||||
| 6 | use Ext\Test\Test as ExtTest; |
||||
| 7 | use Ext\Test\Buttons as ExtButtons; |
||||
| 8 | ?> |
||||
| 9 | |||||
| 10 | <?php $this->block('content') ?> |
||||
| 11 | <div class="row"> |
||||
| 12 | <div class="col-md-12" <?= attr()->bind(rq(AppTest::class)) ?>> |
||||
| 13 | Initial content : <?= cl(AppTest::class)->html() ?> |
||||
| 14 | </div> |
||||
| 15 | <!-- Custom attribute: Event handler on child nodes, using a selector. --> |
||||
| 16 | <div class="col-md-12" <?= attr()->select('.color-choice') |
||||
| 17 | ->on('change', rq(AppTest::class)->setColor(jq()->val())) ?>> |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
The method
setColor() does not exist on Jaxon\Script\Call\JxnCall. Since you implemented __call, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 18 | <select class="form-control color-choice"> |
||||
| 19 | <option value="black" selected="selected">Black</option> |
||||
| 20 | <option value="red">Red</option> |
||||
| 21 | <option value="green">Green</option> |
||||
| 22 | <option value="blue">Blue</option> |
||||
| 23 | </select> |
||||
| 24 | </div> |
||||
| 25 | <div class="col-md-12 buttons" <?= attr()->bind(rq(AppButtons::class)) ?>> |
||||
| 26 | </div> |
||||
| 27 | |||||
| 28 | <div class="col-md-12" <?= attr()->bind(rq(ExtTest::class)) ?>> |
||||
| 29 | Initial content : <?= cl(ExtTest::class)->html() ?> |
||||
| 30 | </div> |
||||
| 31 | <!-- Custom attribute: Event handler on child nodes, using a selector. --> |
||||
| 32 | <div class="col-md-12" <?= attr()->select('.color-choice') |
||||
| 33 | ->on('change', rq(ExtTest::class)->setColor(jq()->val())) ?>> |
||||
| 34 | <select class="form-control color-choice"> |
||||
| 35 | <option value="black" selected="selected">Black</option> |
||||
| 36 | <option value="red">Red</option> |
||||
| 37 | <option value="green">Green</option> |
||||
| 38 | <option value="blue">Blue</option> |
||||
| 39 | </select> |
||||
| 40 | </div> |
||||
| 41 | <div class="col-md-12 buttons" <?= attr()->bind(rq(ExtButtons::class)) ?>> |
||||
| 42 | </div> |
||||
| 43 | </div> |
||||
| 44 | <?php $this->endblock() ?> |
||||
| 45 | |||||
| 46 | <?php $this->block('code') ?> |
||||
| 47 | <div class="card code"> |
||||
| 48 | <div class="card-body"> |
||||
| 49 | <?= highlight_file(__DIR__ . '/code.php', true) ?> |
||||
|
0 ignored issues
–
show
Are you sure
highlight_file(__DIR__ . '/code.php', true) of type string|true can be used in echo?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 50 | </div> |
||||
| 51 | </div> |
||||
| 52 | <?php $this->endblock() ?> |
||||
| 53 | |||||
| 54 | <?php $this->block('javascript') ?> |
||||
| 55 | <script type='text/javascript'> |
||||
| 56 | /* <![CDATA[ */ |
||||
| 57 | window.onload = function() { |
||||
| 58 | <?= rq(AppTest::class)->sayHello(true) ?>; |
||||
|
0 ignored issues
–
show
The method
sayHello() does not exist on Jaxon\Script\Call\JxnCall. Since you implemented __call, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 59 | <?= rq(ExtTest::class)->sayHello(true) ?>; |
||||
| 60 | } |
||||
| 61 | /* ]]> */ |
||||
| 62 | </script> |
||||
| 63 | <?php $this->endblock() ?> |
||||
| 64 |