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 .
d5238a47-5950-c84e-4da0-e4c032a83024
fd58f6d0-d6ea-d00e-206b-ca206ae4d5cf
e6ff045f-44aa-ee84-780c-bc9c7b434a77
bff8fdcc-aa28-c5b2-cc9d-23d86f377508
5a186400-32c1-5563-4d97-1677764a65b0
8d7029a9-19c4-ad80-76b3-eff712a398d1
6492d436-becc-c1d0-48c7-44a791760f56
ce5b6d1b-6ada-7845-22bc-9314e13dd178
83747ba2-df65-649d-bdc5-cc20b4ed4469
8ef3a1d3-1db3-6de6-8365-e650a37769e5
b3c8fb23-c12b-c1ae-5cfc-4eece264795e
2b450892-c890-ebc1-b941-c334bf58e1a9
c5a5ae68-3e2b-157c-fd64-16f34498f1fd
7c3ae657-1934-bdcf-c873-15329c55734f
5edb1177-cd25-b4e5-de32-1bb1b140d265
902c6435-7d8a-a68d-a7de-8b5f9f918440
b94cd0a5-f709-5dcb-8edf-6b8c4d02ad0b
4f166f07-1c7b-4bd7-83be-c715d0ddd3c0
ba53adb9-9b9f-c65a-deba-d8fac81ae9a9
9bba33ae-c5cd-31eb-9893-6f10579b9b77
34ee8b2f-8950-2ee3-b65a-4c429f77b0e2
4b33a337-ed78-9a37-3dc0-db6315c6273d
cf0666e4-91d0-f071-48b8-9beb8f5e0342
82befbd0-8bb1-6509-eae0-fa36d51545ba
4f56c6da-3633-82a2-32c6-4c6831ae6339
9a22d945-e565-59b9-466c-533ad8e1375b
d76bff3d-53ed-fbd2-3bcc-30ced319eea0
c3ebdcf7-5f12-8624-e513-3423935fd4dc
74f33b26-656d-24c2-3fc1-a5455fd19390
7ca750ad-a5fb-1df4-44f6-16293240e0f3
c0f2618b-581c-63c0-74bd-a4f1c63d915f
9209de73-2e18-a282-5ae1-38d521afc59c
a0704821-e216-cd56-5c34-f787e1ee04ca
4083824f-7506-f54f-72a9-4d77375bb710
166616b8-6161-472d-813a-ea2968c04039
80be89cf-466e-8e82-3423-c8575c846030
46e703bd-ad4d-cb2e-b9d9-d08532730e3e
be722720-47bd-366b-51e3-42da2d6cb01a
529d139e-8b6b-5cef-fd44-5c05c3852a04
4c7f5e55-e07f-cf17-d55e-5e0f3378c7fb
3c251a4e-70c3-9960-7f74-726376f985d6
cb8f4b3d-881a-37f2-b679-1380c7ef0103
e8028efb-dfc9-6674-92c3-24f98187fea0
d2fe9200-d052-aa8c-db91-faeaa63cb47b
d5fe2a5c-611e-b763-693e-a8f9ce4f36cc
beaf51a0-17e2-5de6-9427-ebae73956743
8620545c-b020-a495-16bf-9dc3e7655088
c5acb9b5-4322-f2e9-28ec-a79922ad6089
bbf06414-eed0-4aa0-c8f0-e6f0d27bebe9
d150fee9-7296-4f11-f82b-504f27c93240

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