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 .
618184ba-2f43-7b2a-aa15-63016d452b1f
185bdd24-2986-51c1-484b-71dc7400f4c4
aaacc72a-adaa-985e-19d2-dc84bdf4ddcb
292cda57-1dfb-935b-7fce-12c03722daea
ef43846d-38f1-2f7f-6f58-a8ca448d1cc9
3bcda5c6-b68d-a655-2a34-bb8b75b361e5
29665508-dfb0-f9b7-59a2-b332ed87fe0c
87e9677f-1681-c86c-f229-8e2716865d57
1b8c7c9e-3641-fb6c-8310-83934b932a05
65b8a3c3-72bd-4290-5cd7-9c487d2a53e4
cc4f3046-1ef5-47d8-a9ca-23cbd44e6f54
5f6f4518-a10b-e401-20bb-b9dcca78096b
495ecfed-6135-8f4f-a6be-a7267bc89d27
5a175845-5a71-38b0-c193-7cb07bdc97bb
de0160f8-2294-a04f-b9f4-165a9a17f544
8d187b12-e341-b268-e12d-75a82b0300bf
9991b543-4741-bf3d-3a16-4ef8c0167c80
d1f5d067-7856-6345-5220-12fd4eac09d5
49fc18a3-42d6-49b3-fb0a-8cbb9c849db6
7a11a112-e00d-16ee-349a-ed961d316d7b
cb0f7523-dd3c-9d44-b278-3116352d55f4
770358f9-96e2-3f64-9774-2517c130385d
947140f0-64ee-5547-8145-128ae06eaf44
2ead9185-3126-aaa1-ca80-e483319f80d6
661c3376-a9c0-9c3f-a836-81cb39cc025f
bb0e275d-d869-c5ec-9e92-10354915ef82
7c279291-f115-df22-7f8f-3a32f178e800
40dd9442-ecdd-4b53-938e-490bdb506aad
528df720-4db1-369f-42d5-45936f05dec5
818c4053-b1de-41d5-c55e-2e604f081990
919f5417-15ec-6ef8-87eb-814a7dc60738
eed193d8-ce10-786e-6295-83e879ba7f12
d2334b15-af0a-c991-17ce-4d3393ade3ac
b7a4e034-585b-ce1a-3042-48aba179950e
1e289fb6-a389-6b03-e746-7478c6ed3a3e
dac8486d-1dc7-e6d2-445a-158b2705fc05
d3189cad-b1b5-390d-7047-3aa0527cd853
af3592b2-a5eb-7a45-4094-36577f0ed422
cedf06cc-bc58-3cc1-620e-61e8685cd1a5
746a9060-b698-a2de-6012-31526ebd4674
22fd671b-3af8-f797-70ce-4c302a3a1212
6e4a9fb9-253d-ef59-8ac0-70727211a139
4974842e-be1f-9c80-112a-7fbb4a2afcf9
b6c73ac8-c307-66e4-81eb-6ee937ff5937
583011be-4d6f-d9cf-456a-8954968dcd40
72c5f970-4774-ca0b-7eca-3e745d6184a0
cf432aec-534a-54d9-2200-86b4dcccbb08
60ceaa3b-67ed-4037-fc92-32b42c7c4ec8
174abce8-f664-7047-49ce-bdc085756420
2a7acd74-69ed-176d-95f0-2780810705fa

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