jaxon-php /
jaxon-mono
| 1 | <?php $this->extends('templates::examples/layout.php') ?> |
||||
| 2 | |||||
| 3 | <?php $this->block('content') ?> |
||||
| 4 | <div class="row"> |
||||
| 5 | <div class="col-md-12" id="div2"> |
||||
| 6 | |
||||
| 7 | </div> |
||||
| 8 | <div class="col-md-12 buttons"> |
||||
| 9 | <button type="button" class="btn btn-primary" onclick="testSyncRequests()" >Test sync</button> |
||||
| 10 | <button type="button" class="btn btn-primary" onclick="testNodupRequests()" >Test nodup</button> |
||||
| 11 | </div> |
||||
| 12 | </div> |
||||
| 13 | <?php $this->endblock() ?> |
||||
| 14 | |||||
| 15 | <?php $this->block('code') ?> |
||||
| 16 | <div class="card code"> |
||||
| 17 | <div class="card-body"> |
||||
| 18 | <?= highlight_file(__DIR__ . '/code.php', true) ?> |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 19 | </div> |
||||
| 20 | </div> |
||||
| 21 | <?php $this->endblock() ?> |
||||
| 22 | |||||
| 23 | <?php $this->block('javascript') ?> |
||||
| 24 | <script type='text/javascript'> |
||||
| 25 | /* <![CDATA[ */ |
||||
| 26 | function testSyncRequests() { |
||||
| 27 | <?= rq('HelloWorld')->ssleep(5) ?>; |
||||
|
0 ignored issues
–
show
The method
ssleep() 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...
|
|||||
| 28 | <?= rq('HelloWorld')->sleep(6) ?>; |
||||
|
0 ignored issues
–
show
The method
sleep() 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...
|
|||||
| 29 | <?= rq('HelloWorld')->sleep(1) ?>; |
||||
| 30 | <?= rq('HelloWorld')->sleep(2) ?>; |
||||
| 31 | |||||
| 32 | <?= rq('HelloWorld')->ssleep(5) ?>; |
||||
| 33 | <?= rq('HelloWorld')->sleep(6) ?>; |
||||
| 34 | <?= rq('HelloWorld')->sleep(1) ?>; |
||||
| 35 | <?= rq('HelloWorld')->sleep(2) ?>; |
||||
| 36 | } |
||||
| 37 | |||||
| 38 | function testNodupRequests() { |
||||
| 39 | <?= rq('HelloWorld')->nodup(5) ?>; |
||||
|
0 ignored issues
–
show
The method
nodup() 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...
|
|||||
| 40 | <?= rq('HelloWorld')->nodup(1) ?>; |
||||
| 41 | setTimeout(function() { |
||||
| 42 | <?= rq('HelloWorld')->nodup(1) ?>; |
||||
| 43 | }, 3000); |
||||
| 44 | setTimeout(function() { |
||||
| 45 | <?= rq('HelloWorld')->nodup(1) ?>; |
||||
| 46 | }, 6000); |
||||
| 47 | <?= rq('HelloWorld')->nodup(1) ?>; |
||||
| 48 | } |
||||
| 49 | |||||
| 50 | nodupCallbacks = { |
||||
| 51 | enableCall: true, |
||||
| 52 | onPrepare: function(oRequest) { |
||||
| 53 | if(nodupCallbacks.enableCall == false) { |
||||
| 54 | oRequest.ignore = true; |
||||
| 55 | console.log('Ignored request to HelloWorld.nodup'); |
||||
| 56 | return; |
||||
| 57 | } |
||||
| 58 | nodupCallbacks.enableCall = false; |
||||
| 59 | console.log('Allowed request to HelloWorld.nodup'); |
||||
| 60 | console.log('Disabled request to HelloWorld.nodup'); |
||||
| 61 | }, |
||||
| 62 | onComplete: function() { |
||||
| 63 | nodupCallbacks.enableCall = true; |
||||
| 64 | console.log('Enabled request to HelloWorld.nodup'); |
||||
| 65 | } |
||||
| 66 | } |
||||
| 67 | /* ]]> */ |
||||
| 68 | </script> |
||||
| 69 | <?php $this->endblock() ?> |
||||
| 70 |