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 .
d04ac33c-f89a-155b-8c2d-c7be8577a632
58867478-eefe-db26-8ebe-8d7654116d93
20afa425-4136-e09e-f2b8-5bbdbe23ead9
b0eb2d0e-5f06-44df-18bf-e67540367d50
a70db832-5b1c-6f71-c7cd-b3bb692114ef
9bf06c48-f43e-2dc0-7ce7-5bb08bd10e53
2440be66-5136-57d5-4a77-ed2757191f80
81ea7a45-6451-f8cb-fd57-721a48a9dd11
76e476af-3dc2-98a0-2a97-8f1d18b48dc9
e4bfcefa-519a-dac8-d8b4-5c67c790e1e0
17ba426b-d35d-dade-fefc-899e3d9eaee0
ee7c31fd-60cd-d3fb-c720-8197a70b9096
c549e58f-a531-2d42-c52e-30c11bf0a0e7
983e80a6-58d6-a304-422a-99c12a08b97e
cca60834-bf6e-9596-796f-d9a3633b1c63
adee3c03-3e69-9d1b-f0be-e98964f06013
6048a2cd-a16a-d89a-bdc4-5fb1609eada5
7a72b060-79d5-2f08-378c-b969ac7bfd57
9a143d60-ab46-d880-8feb-f6a13503b596
95a3e79a-f826-5ca6-13ae-c0e09d97b8b8
ebf3b821-cb61-d20c-a871-3d1b49d3c222
d86b7062-885d-aeba-17e0-6c806dfabed5
53cbf491-8d8f-64ca-3637-9131b6465b95
b6640be0-2cc3-b875-e3c2-3e88669843d2
3b5fd4c3-c18c-414f-b332-9ff5aa6d62bb
92e7a264-19bf-f524-7dbb-62887465ef5b
799c5e90-92e1-2591-dd8e-fcef8848962a
d64af591-71ba-2efd-18fe-42cd25eaffa8
8a496371-7dbe-a620-b46b-9f771aaf3824
5f7d7157-f019-2cab-2260-f56ec7c7cc93
dae9cf30-3e77-be0d-55cc-a2757a7dd3bf
345cd8ff-3eb0-8b90-a732-e433e8eefb40
5efe2e68-617f-2010-de27-2552d3d594a5
16ddd6af-5915-a0c6-b460-fdd1d8b12980
a493a7a7-49fa-7f65-5593-a6c77cf9a260
e068d693-bf4a-f240-69a6-f4da93604c24
1c611350-df50-56c9-c53d-326fec188862
ac93ba20-a292-27a8-6d69-d654391d70ad
3960d1ca-53bc-d5f2-de9b-c367d5561560
cea406c0-fc0b-a1b0-528d-26cedf58fec3
bb484c72-f144-d4c2-c1da-229e12ccf2ef
b2fcfd2d-b564-97db-bea1-7997cc21c42f
93e302e6-c0e7-4e3c-9d1d-7ce0c867c34d
2c4d526f-5f00-dbf0-7978-3952df5b0e55
3dc17a57-eff0-4734-d06b-81d35a23c789
7404de6c-fbb6-715a-2ca5-19995e6bc7de
56b0086b-e190-9a1b-eb62-f02dc3389130
7923c31f-f7c0-8713-36aa-f678132719b0
1c442504-c6d3-7317-bd04-59058e20f8e9
d45bcdaf-f997-4c92-2710-f50137fa4245

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