|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use Jaxon\App\FuncComponent; |
|
4
|
|
|
|
|
5
|
|
|
class Misc extends FuncComponent |
|
6
|
|
|
{ |
|
7
|
|
|
public function simple() |
|
8
|
|
|
{ |
|
9
|
|
|
$this->response->alert('This is the global response!'); |
|
10
|
|
|
$aCommands = $this->response->getCommands(); |
|
11
|
|
|
$aCommands[0]->setOption('name1', 'value1'); |
|
12
|
|
|
$aCommands[0]->setOption('name2', 'value2'); |
|
13
|
|
|
} |
|
14
|
|
|
|
|
15
|
|
|
public function merge() |
|
16
|
|
|
{ |
|
17
|
|
|
$this->response->alert('This is the global response!'); |
|
18
|
|
|
|
|
19
|
|
|
$xResponse = jaxon()->newResponse(); |
|
20
|
|
|
$xResponse->debug('This is a different response!'); |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
public function appendBefore() |
|
24
|
|
|
{ |
|
25
|
|
|
$this->response->alert('This is the global response!'); |
|
26
|
|
|
$xResponse = jaxon()->newResponse(); |
|
27
|
|
|
$xResponse->debug('This is a different response!'); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
public function commands() |
|
31
|
|
|
{ |
|
32
|
|
|
// Create a DOM node |
|
33
|
|
|
$this->response->create('parent', 'div', 'child'); |
|
|
|
|
|
|
34
|
|
|
// Insert a DOM node before an other |
|
35
|
|
|
$this->response->insert('sibling', 'div', 'new'); |
|
|
|
|
|
|
36
|
|
|
$this->response->insertBefore('sibling', 'div', 'new'); |
|
|
|
|
|
|
37
|
|
|
// Insert a DOM node after an other |
|
38
|
|
|
$this->response->insertAfter('sibling', 'div', 'new'); |
|
|
|
|
|
|
39
|
|
|
// Add an event handler on the target node |
|
40
|
|
|
$this->response->addEventHandler('target', 'click', jo('console')->log('Clicked!!')); |
|
|
|
|
|
|
41
|
|
|
// Bind the target to a component |
|
42
|
|
|
$this->response->bind('target', $this->rq('TestComponent')); |
|
43
|
|
|
// Bind the target to a component with item |
|
44
|
|
|
$this->response->bind('target', $this->rq('TestComponent'), 'item'); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function jsCommands() |
|
48
|
|
|
{ |
|
49
|
|
|
$this->response->jo('console')->log('Debug message'); |
|
50
|
|
|
$this->response->jo()->console->log('Debug message'); |
|
|
|
|
|
|
51
|
|
|
$this->response->exec(jo('console')->log('Debug message')); |
|
52
|
|
|
$this->response->exec(jo()->console->log('Debug message')); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public function paginate(int $page = 0) |
|
56
|
|
|
{ |
|
57
|
|
|
$this->response->paginator($page, 10, 25) |
|
58
|
|
|
->render($this->rq()->paginate(), 'pagination'); |
|
|
|
|
|
|
59
|
|
|
} |
|
60
|
|
|
} |
|
61
|
|
|
|
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.