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 .
2a6993b4-ffec-89c7-4917-14453afe5158
23e90cc2-db17-eb04-9868-c0bd9a8504ea
6f0167b4-887b-8a7e-2f96-6dd318ed5a1c
5cbcf65f-91da-4cab-a299-611da49b6230
2c160dec-8a2c-2c8e-fd75-ee099db820e8
a9134b9c-863a-8235-dce0-530f49a924e6
adc7d884-cd19-9355-78f5-447dc7ff9f67
5beb8075-88e1-6c29-5b13-7f5fadffd560
9efa713d-bed9-5398-5c8a-65c6575a5d13
22458492-5545-6ad3-68c2-385b7e4deb97
b9698181-a7ad-b4bb-7e9f-b7ec1591b1c2
285f417f-5ccb-f5ea-9ce7-b9cecadd7fdd
64fd252f-9bb6-f5c5-4d9b-93e267027f5b
c9706d54-2689-8dfc-7600-6f99b1d41f4b
34c48fb3-5303-e401-53d1-328f8e71511c
b5358746-296e-7440-d241-c4ce2e67ae04
d69ecbbb-22e8-36c1-fa43-ee9f791d30d4
dff60135-f302-a2e1-7b09-279350396ad5
9cbcd450-a13d-5241-d20a-1765b53f74a9
b40112b5-eb97-ffcd-7c6c-60053949731d
2e8ff774-5b84-e2fc-6f5d-becda0f60086
9c248c79-770d-be83-3ebe-ae637bc2d7ae
bcba5d4d-6f2a-f94b-184a-4e8051f9b2f1
6bf333ae-7678-cf65-2e4b-1ab1390cc06e
7eda1940-35d5-b43d-24db-d502b54e9a94
abf52b6f-1d20-4749-d013-8f4a4b785eef
fd093620-a61f-5d32-9527-ef035e6ba8b4
c42dc91f-5ead-3fd0-b733-6ba5951245bb
cce991ec-9443-3dce-6c51-334e88fa4c76
b0ae6268-1200-9881-6a3f-34a246801470
197b618f-5311-70e0-f4c9-26eaa81a0172
5de3db58-9e6e-5e4b-b3c2-7a3f7136bf70
100390f8-bfd5-4869-8c25-ea2289add137
7ea9519e-d2c8-e15e-d5ce-581120b21074
8f625400-ce78-4335-9b9f-72d0565dcac5
1105f70c-1605-f59a-1158-5105e0607820
c39771d0-867d-380d-7937-e9a761d2637b
422708c1-1360-3700-bd07-d9fed916f3cb
b37cce1f-d1be-4365-b459-cd2eb0058232
ece2061d-1778-5899-acda-461cbd2634ff
e9f1f2a9-a89d-be9b-9ffc-175e19e364a0
d287a98c-bdad-fd14-e5b9-39609678cf60
589664f9-41ce-1b39-e255-215250e02d67
bb75fdad-476b-c24c-c3b5-de11e497ddcc
b2ec9efb-fd30-e21a-1a20-95273b55d988
491ac968-9ac0-3e59-e2e7-9a4d2fec4aca
eb6ca072-8f28-8220-14b1-f268bb9a85f3
ee237015-33e6-3d3a-42fb-58cdb27408a9
411bd3ac-6395-3211-6e30-c5f69ab752f4
66c32474-ece4-6105-c80e-124276e8b79c

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