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 .
cb341130-2323-e64a-4e64-aba54238f710
ebae351e-d16a-2e99-230a-6aee9d8e0a19
4668d3d3-6a9f-e8e1-dc81-c2ab6ace9324
d6c1e506-49d1-8c57-c897-6bcbc0936de8
83c01083-7f87-c485-ab4f-4f186bef0154
4d0a412f-c18b-1c72-a2e2-3279a3142e38
2746030a-f341-80b0-9cb5-8ab0d0647d5f
61010ad0-82e0-5c30-fc38-a73fa46a8558
9098862c-9758-40f9-c5a9-6584199eec48
40abad14-3f85-e3c9-2531-951945dbd000
cd567275-c746-51e9-8850-1584b9d4e414
531294ff-9594-96e7-2f8f-d28183479fef
2115ed3f-dd21-b90e-d4d8-189d9104901e
64c2be25-9281-fb3a-51d5-9a6d38befda9
91b26c2c-71a9-7452-27cf-38b6b38c0dfc
40c5e780-1e7a-f24d-5737-72154e72fbe7
df8da5d6-e93e-acd7-aafd-7a85acae746d
630989c4-3d72-eaf9-a67e-1eb230ef51fe
ec5e7730-c773-f2e4-286b-b861bb85d500
8c857e2e-5b7a-b41a-483b-3821e1a5b406
30d33343-1d51-b3ae-f52e-962075f37a7f
26c019a9-cc0e-54cd-3f4a-ff0cb573c896
40d433dc-fe64-2f04-791a-5ec57fb02dc3
9eb2cef6-af24-7d00-5a30-10c4cdd98485
79eb5b87-2ca2-ff83-4a93-946b2fc621ba
c5357e58-90aa-b0cc-fb19-dab250ce5fb6
c218030e-6bcc-382b-2470-d289a7bb95d8
9b3e4680-1ad6-6a69-cb23-e850d3873c75
27d24569-ff78-7f77-16f9-d1c7e224b460
641578eb-fdf9-6523-945d-c3a78942f9e6
aec1b3ef-1340-b4f6-fbe3-3d00ac17b62c
83985407-6ef9-b892-c8b1-45d9eb7a8671
8a4cd2b9-c48d-ba49-d74d-137a14d4f5b2
54e65ee4-c299-2e6b-e8e5-6577e0ca827f
ad406930-f8c0-84b3-70f2-efba21987cd2
b800f6a0-cf35-7381-5dd5-4cc24ef12882
664c3870-26fb-4528-fcc6-826f204d7356
82c92def-eb95-70a0-670d-e47c7073e5e7
479052ca-7bfe-eaaa-4761-f0997978baf3
cdc16ad9-f3e4-c5bc-a35f-7b531b354ee1
3f6b5766-7c30-acea-b1a0-f04f752916d1
40d5be10-b680-ed22-44ad-4030e15f8e7a
6f6c587c-d161-c3be-a8a0-b5cc25188e60
e3b82448-24fe-2200-8bf3-42d870932000
6b22dcbf-b280-cbc0-45a1-6105bf42f09a
7b08edc1-ec54-a4d6-a39b-1c68986c755e
43de62f6-6df0-77c1-883b-72306f91b738
af7c8799-9c60-9653-6fa5-e597a4a4f3b0
73f8cd7c-4f68-7519-40e7-7cfd4eb2f144
464d83c0-e219-c7df-6d01-3bd167483bdc

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