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 .
a9d50017-1842-abd7-1308-89cba883c19b
e331317a-b145-f5d5-f170-1312ca8bd70f
4b6b22af-a16d-d520-90e1-5005e1ce015f
4d453a41-e7ab-b807-735f-c621b238339f
85ea03bd-fe98-355a-563c-431aa53b358c
d52e388f-cab0-ddf7-9c03-f232a20975f3
9d4e4bb5-206d-6f4b-7210-46b835a68bc5
a6e68ff5-e6f1-5a8a-68dc-6448bbd1505e
20cb2932-7a68-af8e-b000-a99dbd32b2e5
c1f05e50-e7e5-1ee7-cb6d-a201145a3734
12ea0e90-1c1d-dfe4-a5f8-70758d09087c
b5f61910-6c13-dfce-8332-609f11d933ab
35e2a60f-b279-8740-6459-a08ce0b859c1
43faf965-13e7-196e-5bed-d08111ef0935
8f3a22c9-6bcc-a455-4bee-5bfc43c99892
8cc7f76b-37c0-da68-b8e0-130522ceaed2
788e111f-ee54-3138-8173-138ac9bef0d9
e433f373-25bb-b940-c31d-e3eba92be779
91303ef5-eec9-2eef-90e0-12d02a2e6e93
ab93decf-7c8b-a2c9-6823-7e2dbf0403b9
9dec38a0-2d8f-42f1-bb90-562fa2b08c03
31ceea45-f7aa-4d72-bbc6-5173779d4feb
e4a25633-3a75-1a29-4c75-aaeb3cbcf0d7
9f28e82c-65d7-9528-e129-c920c920f594
4df48c1a-67fb-a919-cae3-97148d6bc65c
43068eed-c125-3c09-cacc-2d1c7ea70970
860b9de8-a045-2296-db54-ac65e5c3cb60
2d233ec6-be0a-2e7f-c2fc-75b6860068c2
50b8b0ca-9ec5-624a-76eb-e31c7b951bff
40f38eb5-5f49-bdec-8001-bcf0b6575e18
6598588a-a259-b520-7b84-c850336f6c85
45458b92-cf62-24a8-846a-4a744e0af2f0
bfcec903-4f00-3826-b2f1-bd37de265131
20d36716-1610-a259-3155-5f484a139b63
6ff25913-c9c2-c83d-9d90-779a33c8708c
85ac9476-b339-49bc-9a36-159a6987f6c9
139043d8-d905-1608-2fa4-6bc57c2b7f87
dc98d6f1-61f0-7567-2cc6-175989ab3add
d67b9ff0-a7cd-e2e6-ea0c-173e6053f434
d2121777-bd2a-4cc0-97f4-805ba7226670
30659738-f1b2-daf4-d939-9e53235807c3
5bd10821-1a3d-c920-cf43-b018899ee19c
dfe7ade7-dcae-127d-c950-dcadb57c32aa
1acda582-275e-55b6-3e84-5ca82b44f786
1e0146fa-25a9-4280-d8a5-a854a97031ef
a480570e-a2a8-3544-8da0-c430a967c8fa
ca6ed8b7-d950-5f09-f277-9bf9c15792e0
8cf2b72f-990e-b021-ff50-9050a90eedd3
479db280-2496-2e0f-2665-fc2cc4ffb1ce
3ea3ff73-1e67-5423-2a70-11b66c1d457e

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