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 .
53174f6b-a83a-2364-23fe-5d1a727aead2
e5352225-978f-d6d4-1ad0-30a9b808c2d2
11b91f6b-318a-3dff-105f-a4529ffbf8a1
b3c3e1a6-ff10-78e8-5e86-2068df3de9d0
d2db5e6c-aa42-a200-4d25-e783843294df
54d53485-3800-57a1-68e5-b079d08740b1
1d546c42-5e07-575e-4d99-e83c9dac9bbb
12bfbfba-2580-34a0-fb8f-d999e59ba269
58e9c766-d45f-c443-74a0-d74556899e80
379e1092-5e44-749d-1ea0-100de0e762ba
88aca037-eb91-a54c-a1be-36392d56f10a
4f7684b5-2c52-b405-eccf-1ca431f67a09
348ec9f4-8f41-cad3-3f13-3e8173777e22
e3b22f57-8632-6577-2804-d0acc8d71d14
8742e9ea-5ec2-c2be-14f5-1c08d2e884e7
9d7c24c6-3a0d-1837-1fb4-95d5cbe21559
299bc970-5a36-2ca6-475c-9adaba78df32
2a1568b3-60b5-6e31-126b-83bb8b20e2c0
124f675a-4185-d8ec-57d0-c59954d56864
37cb4da1-9c8d-6a8a-b215-c1b686e3db31
9d06caac-1e03-7488-df85-7ad764c0dbd9
3264e3ce-2f69-eadc-6040-d5ea80e6f878
93f0ae74-a9d1-9fdb-5fd2-f741e36ddd4a
69a5a29b-d782-d762-d13d-2e1dcd7dd980
56b3580a-4740-9527-180b-deca900ba580
d57be2cd-7202-62f3-3130-f9208236f109
aa7b8d43-c521-6fec-210f-6a4f1ce1a207
96a09dda-f0d4-35d6-7f81-1de6c33c7d80
1862d962-a800-ef5a-e245-c2c22fcf07df
ce15d41c-7564-adbc-c796-5ece3504aec9
b494eeee-8270-98d4-3f1e-8e0feadc27b9
9e422442-a8ef-4c66-3941-b9dddec15d2b
b5f2ff14-4336-d940-78f5-15f4d4025bea
96b271ca-9b79-6688-d201-d69094c2ef97
274d8880-4de4-a3b0-858f-97ebe6647a4d
9a546ba0-2f12-70b6-4e44-e895551f1a04
a1ecacdc-738c-fc9a-22bf-f89add52be47
cdf39daa-4395-6c6c-c97b-a2956c847897
caf90ca0-da49-a1ca-e46a-c8abc5a054c9
c5710101-aedb-2e6f-78fa-71baedb9dcf8
903d3b99-e3e5-2f1d-cc14-f92f789267b5
7c603e20-56f3-f80e-eb61-3130d91967b8
42bbbaf5-b3e7-6aa4-39ff-fc7cadc5b216
3793b799-6c16-4a31-1e8d-ae812bfb73ad
75d3534d-8587-2471-8f69-2c7ea09096e0
a5ad1eb2-cc3f-61bc-91dc-111b5bceda01
a3c30398-3501-f05b-fb48-d17f281e6d20
ebb3cf34-1d32-d5db-ac37-6b467941e6fa
3ea389b9-79a3-777a-ac7b-d21bdfd66f45
6fc576f8-26d6-bff6-284f-5b50d9f3d9d7

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