Exampels

Set Content

Demonstration of setting content for an arbitrary element on the page. The onclick event for the button is set in the PHP controller by the Main method Examples.

1
2
3
4
5
<button class="SetContentBtn">
    Get GUID
</button>
<input id="GUID">

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
    Sets onclick for GUID button by className
*/
public function Init()
{
    return $this
    ->FocusBody()
    ->FocusChildren( 'SetContentBtn' )
    ->Event( 'Test', 'GUID' );
}

/*
   Sets new guid for GUID element
*/
public function GUID()
{
    return $this
    ->FocusBody()
    ->FocusChildren( 'GUID', self::ID )
    ->DOMValue( clGUID() );
 }

URL without reloading

The example changes the URL of the current page without reloading it. The HTML code sets the onclick event via the HTML data-event attribute.

1
2
3
4
<button type="button" class="ChangeURL">
    Change URL
</button>

1
2
3
4
5
6
7
8
9
10
11
12
public function URLParam()
{
    $URL=$this ->GetURL();
    return $this ->ChangeURL
    (
        $URL
        ->SetInteger( 'Int', $URL ->GetInteger( 'Int', 10 ) + 1 )
        ->SetBoolean( 'Bool', ! $URL ->GetBoolean( 'Bool', false ))
        ->ToString()
    );
}

Post request and authorization

The authorization example demonstrates how to work with POST requests through a form. Password containes the login plus one "*". It can be found in the PHP example .

Authorization form

Upload on scroll

Demonstration of loading a dynamic list. Scrolling to the bottom of the page loads the next GUID package.

PHP on Git .
36d5287e-e49c-c129-1bf2-3ceb314bde40
463b5186-ce89-f8a8-b8b9-66ffeca26c5f
a3d32a37-2cad-3ae1-f5d3-4ae824f47552
8b54b17b-ffbf-4a83-c4ae-164d3c1d6ee1
485fce3c-6089-3ea0-545e-b64763ba544e
1448ff7d-e275-105f-679a-a15974ebf3f0
6bd268f7-a3d7-7c83-37c0-251c8cd0f3b0
232a5090-2fcf-fda8-34a8-6458543b295d
7e81da01-f7a9-66f7-b48c-58789e794bf2
30727a9a-675a-22d3-20e6-60d02e433b88
2373683e-ea58-e41c-f98b-a8de6d7d7f81
bcc26288-507e-a9a3-ce63-a5edb3c0cf50
8defe08c-e52a-b8f0-ee14-cbaf8444e846
e5eca785-2cd9-c64c-4ba1-d0bec9e168aa
84c87c6a-6fe4-1770-97fa-924cb6beed7e
72634e30-af56-2a9f-f49f-31d4ba5274d7
7650a8be-8463-109f-529b-3878814bcc8d
c2d64bc3-69aa-d92e-7974-65239021b7fb
cda7d09b-52a4-795f-eed5-12ef974b06fe
d1c918b5-466c-5139-da91-bee0d913c205
52363222-198e-54cc-d1e5-976144761d40
aae64b30-14c0-2d53-4620-9045522484d0
c7ae2f33-12b0-8910-4636-38002cf1c1c0
6b3e8b86-4441-5035-2f0f-8da4827f4095
8cf8b67c-c360-51fe-3e6e-7f6b66ccdeed
def7bc11-501a-d213-d05c-4d283351acf0
393600ee-6fb6-79be-4652-c6aebeab2a30
9a6653c8-e2e3-4dc3-40b6-a29cd938ba10
dbedad7d-83f0-3d06-2189-c26e5a3af760
a2357963-bfa1-5ade-4fec-f4bb642e3800
b4ddab03-b33e-b20c-682f-82c948843ff8
8a11dbc7-a380-5645-2697-d3c02f4a624b
340a0248-1cc5-d182-b120-9037a5f3671e
58d03402-cc70-5f99-b824-ded462106dca
694226c3-2c4d-97b4-2204-fe6966a79e6b
5e2c46a0-7516-f700-ed5b-36c0989922df
1e847265-f4ba-b6da-70f9-899a61d5819e
96236870-a85d-72f0-982f-e1089bc16ca6
400d3021-bf14-8b64-1b35-a3f0c73ca512
71d74631-d32d-f2de-c4af-c51ce2ecd2ad
1de03d76-ab63-bd59-9e63-9c5f4205f3bc
413c2721-a790-8839-4bcd-cdd02ac79aeb
2306c447-8bd2-d953-e440-9d94a67c4602
90e4fc4a-1538-e12b-728d-356de022c828
a581cf60-c6d9-8874-3717-8230dd4372e1
5755bbe2-d2bd-433b-ee98-ddd448d752f6
77c41b3a-4cdc-6750-f6fa-20b9eb78c3cb
7a7aab7a-3a2b-aa04-ce40-17998ede4dae
c0628a25-ec60-9f56-c86a-35f6e82a48ee
e5ab4449-8141-7cdf-7142-630975289b3c

CRUD Form

The Form shows an example of CRUD operations without JS. This is visual demonstration only. PHP on Git . A full CRUD demo for PostgreSQL and MySQL is hosted on the TODO demo site .

Images used from https://pics.photos.

Timer events

You can start timer for any object. PHP on Git .

Event handling

Demonstrates three methods for handling DOM events. PHP on Git

Clipboard

The example copying text to the clipboard. Сopy event is used without calling back. PHP on Git.

Form

The form example. PHP on Git.

telegram
Developed on Catlair 2021 itserv.ru