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 .
11b6a877-c8da-4fda-aab3-e4a2bc3f7447
2647084e-e76d-6a1a-14eb-c60e7401d330
364d95bc-efa1-531d-4682-10c1e6082a67
c8d77ebf-9a20-9b18-74ba-ea7a64d6e816
ba54c83a-2cea-f99c-5892-d70733b1f0fb
75c85a80-8f7c-ef03-8774-4ce66bef7555
8c030ca8-9602-f5b3-b258-6a7dbdfb45a0
90c43d7a-d414-2019-ac11-f38aafb1159e
b700c471-bdd6-2361-8997-f3da2169a752
a8cd81c7-e528-c7a1-1a98-34477f20aa66
cb0eaea7-a445-f5d4-7bae-b061b7826583
df0b2543-ab5a-2845-f114-fb7ca2521952
c06aecad-1d0b-a3e7-d4e0-730e8d53fb40
1a01eb5f-9b5a-4ad6-6b11-a12fb38ca920
c5a92333-4e36-fdf0-bab3-b9e0d673feab
aa8772b6-5228-31e3-5fcf-67f047c4de58
b34b4528-32f7-cc80-6476-7c8fae3b3f26
19703230-f745-d765-c081-612c294a84f2
db88cc18-681e-c33b-e8b0-fbf6205c3b33
bd4a599c-16a2-8626-c736-34002c444e8e
7cb6eed4-1d32-7225-e149-34567b711226
a0980c88-781b-4d3b-34a5-3fef2d2e8dc6
2eb04a3e-423d-92e4-669d-93a3d9250937
b07cfb52-d06e-5f9c-b7ae-ef30ea996111
b71685e5-653d-8def-a0d0-6767b67f0bf0
5813a3f4-ac7c-3171-e4ee-ea75a98bc81b
a9194c64-e42e-ae57-6244-e800e203a7ee
ca472b2f-a92c-d977-3629-2a0c1b5b4acd
91c49bf0-d640-d151-9782-9c004d6aadcf
8368bf0d-992d-f521-d29a-5be1386e99fa
862815d9-dc89-c59e-2efb-c416aa2e345d
4beef143-4f50-c66f-a343-3f24bd5ff7bb
6e0c1b66-8e05-525c-6459-261c5ac46454
3cfa46ce-caf4-9ff5-4fbf-76057927b992
1f5b62ce-eaec-5c6d-8669-eb1458c2b20d
d5d15204-ade1-832e-c366-98ef5381db43
dcf62580-82e0-64c1-adb3-7cfeab25f58b
b7196789-e461-26e1-5a09-11e5a3793832
29de0df0-b91d-bdca-506f-7b913bc21389
68d81655-3cc0-3377-6bcb-5e1b48aa8c97
530ad03e-ef2c-dbde-3226-248bc412ebc3
a59ef6cc-c7ce-1a01-4ea0-fc206d1eccde
2d0afa6f-2549-de2a-8aa6-8f9d6bb85473
e1e06154-7ffb-f1f6-4309-ecb1d72a9102
ad981f7c-79ad-17c4-ddc4-d183e8235f48
3fe2d0af-6128-477a-db88-ec099cba3a5c
a9f1be3f-3f23-d71f-f50d-afb038e3c7cb
4d549258-cc84-bb9a-a9db-1638d305dae0
a64dfbf8-93d0-1a67-8b9a-d5b572a5e015
34fa32d8-9c4e-9432-6ff4-73a8ef6f8069

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