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 .
3cccb783-d447-63d1-a8c4-c58f1be5135e
4e4bf815-ddcc-e36b-a919-fdd219459550
8b20768f-5aaa-fb47-4c0e-3bb05d003d1f
b790e38f-7893-5da7-5e5f-60994bd0ff6b
9affc984-7383-5118-69a8-f0a0ea12fe47
ff52c530-a129-8b71-dd78-19d6acbf7262
9f7ae8ce-dec1-9ed8-a8e6-6524d7b0dd00
edc9e2a1-e4ad-72a3-d709-95b934d399b7
734603d4-1703-4e60-95bd-c759b8b0644b
1a43f0f9-836e-9a86-7ed4-92c464819d70
a4330ac4-117b-fe03-700e-f50bb05119e2
e401b633-fd8a-c456-f897-4f198a005d2b
4cc3319d-73cb-a57d-1600-caf74e956929
e9740240-f870-9393-acfa-dd3721470a62
481b0104-2131-2c20-53e9-a1d618f758cd
6ceecdaf-5105-b2e6-a388-b4a27dd5c381
d7a9c705-acb1-c818-dfc9-fa409f92a9ee
d0c43e4c-58f8-917c-4b73-f6993ed73b7c
a8eb292d-3268-38f5-6a68-ae5c162ae8c3
a72383c6-e770-23a0-7c44-ac80cd927614
d78f1174-704f-6d85-2292-8d1f81a0f8c1
4bf588d3-3b3b-e2bc-78bc-652de23366f7
dfb11de1-706e-6a50-ade0-4d42cc70e25d
46f410d6-7cac-d90a-a6d8-81088befdc4a
a2d2df2e-5200-64bb-f480-afd1da727d50
910027ae-708a-788e-431f-e7e860d42d8f
bc3a8a11-6fe7-a10d-b38c-cc7d7f87ab82
5c3b20a6-29cf-124e-6a25-422678465527
e7eadd28-f30c-54c7-e33e-54b8e65016d7
eac8289a-a751-fca9-e359-f56449d44db7
5249fb9d-c592-f423-169c-f35447026ed0
8524735e-8e0d-cd9e-1a7b-9a375e284225
ed532e35-fef0-ca74-8675-18d79c2741a9
91e070e2-1de2-d9f0-630d-11104a4e4e62
a4012fc1-87df-9289-3645-e78d255aaea2
364d7b32-919d-b809-407d-33f29d9e5eb4
4e2249b2-2fce-2915-2d9c-84c1c73a5276
3429f010-14cb-7ac5-1166-6af42256ce10
cb02dd88-34e7-fbbb-237c-fb7352aafa68
aeeb684c-31d0-1f3c-f69e-d87dca079024
ac9baf1d-e60a-e2c0-38fa-cc3e2ca7ac98
440fd076-47c0-e37f-29a6-aaedef9a3dde
6e02b387-87cf-84d5-ee86-bf4e48fdd241
7afeee69-8cee-f14b-6ec0-53cca8ad912c
461a3686-8600-124b-5e0d-fbc1d4340314
586fbbe8-557b-c6e7-e860-b133bd4b0960
b232e879-dd90-ec27-8903-a813d81d3ade
a23ffd3d-2122-35b6-f714-4a1034c2ada2
86133dab-9118-b1f8-e370-a6117d020011
3497474a-a180-7c0b-4065-1d279b3a8380

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