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 .
d6491ab2-7e89-9aff-14d1-e8f66d295a3c
1e395a27-1ac3-2076-4d28-dc5897bfe1cf
cc88a110-63c1-72b1-d45e-497f8e9fcd75
9dd02ac9-8a72-21b2-bacf-ef25e73fb2e1
2fa52d21-e030-bf8d-6000-fc009fb75297
1e91ea48-48a7-8ab0-daf2-3c3936ddc730
44d1dd4a-ddc1-50a3-e300-d23acee4a148
79a80bfe-464b-7d70-d2f7-ce648b78aab0
b46ef24e-f487-e93d-52b3-9e853e00f287
ed50dd4f-f301-a8d3-8fb3-2a6775167b6d
83ec25bc-af48-3ffc-9a1d-f18f9b27d77b
7a66edbd-15f1-c429-e565-49505bac90e5
2788b376-37cb-ef3e-3f39-d2023d988cd2
51a96735-9380-3cb6-82cb-eb9ac4d1b5a6
d9c3b0d0-36d4-d5d4-8820-7b879e720ed2
919fd40c-9807-5f5b-8906-54eedb8f151c
6075cfd0-d161-c289-fcc7-b893ef029f78
2f743662-d4d9-9196-f3f1-e907bad8c5b9
321fe012-dc95-b0a5-da20-32c2c66583b6
8095ac2e-45c6-228f-8055-5de162927fb3
7811c1e0-3298-c9a0-45f7-f87bc938e1fe
8705630c-83f1-3e6f-77f4-504f58df0f4f
75c124a0-de98-996d-d87d-ed5b81b089f8
3a1cf5e4-b3a3-2127-cb6a-31689ebd07c8
277ac4bf-2da8-9f12-117b-f2dc3b8bccdb
4b54ad18-728b-388f-e97a-2c8d49b17573
717659ac-e702-dab0-78e6-979610d7d723
c895d4b9-f608-2bd6-6a76-24e3c5c91fdc
458d6362-3119-2022-c24d-9c97311cf448
57b73fe2-89c8-2000-5a25-9bf81093c027
67cdb597-ac8a-e4b4-4693-a19f5fae050f
91b5123c-de17-ef7b-8d3c-8f5c454ee1d0
207130cf-9eec-9160-57ed-317694de2fa0
607682b6-5085-ab0c-c8b1-71828dd93e87
6096da8f-1662-869b-d37f-45df5e6610a6
a8e138f0-7750-b7b0-61e2-69632229b031
622a0d71-d249-e070-799a-34b064c7c43b
87d98966-bc48-49ba-3c81-a270ce6616a1
2dfae9ae-d7e9-4743-27a9-456e9fc0522f
c7a4814e-6a57-d5b6-8cf9-337ad9016f53
1c09d590-a7e4-6827-1121-786968ad8da5
b6118403-f19d-dd8d-b500-860a44ea4eb9
1d1cad6a-8a5e-4880-85eb-3cb0d605da96
a797b3c3-e7ff-54f6-78ea-a286536be3a8
43a274b3-5871-74d9-64db-ccd0b2d16699
6b786378-25a0-b3c1-7fde-af7441e80ac4
ec086f1c-7fda-8976-40c2-136552d4be89
1b73e98f-fb27-c2d7-59a5-af2847ac6f7f
864a8720-6f36-1dc7-6c8a-8eddad059545
78e7aa00-e42b-85b7-cd12-2e216da2a614

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