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 .
362b164e-5b38-bdfe-c3ea-a335a2c21000
8e7b052e-1ae7-1170-7891-f4953548022c
55635b8c-96d2-12bc-97d0-deac122d28ef
e106c62c-85dd-dd41-f789-14d0e32baf01
7bec9743-f3ba-f704-22e0-594c308a9b31
64b29a28-12b8-852c-67d5-36406deb5600
ae0329f0-e5a4-d540-ad6a-771257a315af
aaa9b8ce-3d1e-f047-a778-af049626b21c
dfd5a55d-55e0-662f-dde8-e0827899a4b5
984a6d81-899c-fda9-4a91-aa4bbddcdc09
177f1b4e-537a-80cc-d33a-cd76209604ad
5d69f2c0-bcdc-7482-73ea-34333d341290
44598bd3-94a6-29d8-4508-2a7a4d4a8c8b
317195cc-c0c9-4d9a-9ec1-a7758870e910
ef812b96-136a-7dd5-8a7d-db475be18773
3c71584f-8160-ba15-770e-e865119820c0
b0cf04c6-ccaa-e22a-d2d6-8e5d9df218e4
6c0c1b10-c074-7341-f073-3bf7afe81c74
17b63bac-fb95-da5d-8203-4a9f4e6c80c3
ad861e51-5a3b-b1c4-e070-1198482684d5
79c21c50-e784-846d-2219-8764288494ab
84e72ce0-a77b-5bb1-6c1b-f409b7f86a07
5cf0ac7d-48c0-aab5-bf73-7763802c3a97
e622e960-2926-59e6-afb8-bfe5539acc1e
9f68a3b5-cdb0-5850-b282-da4cc5b03d32
cb7ad43f-a991-8cd7-5ca9-cee9901d5902
3e3d9692-c835-a8ce-bee0-41008d92d5a5
2cb4fce0-d370-7893-c057-a3a3975ecdf0
ba049b6e-d8c5-6b3e-fca7-f7b78f42ec23
36651247-8830-30c0-53c5-98e9a95dec02
525905d7-ae0d-ce14-d447-3530372983bd
ba8e1750-e93f-f49f-2951-cd249611ffd1
2f5d7a71-c529-9089-e755-523233bf5381
955b0779-da07-9c17-2453-ab449478b6cc
eb8c9805-47f8-af12-9212-65b55a892cd6
50d1ee37-2ca4-b650-4722-4b911fe50b4b
a79e9208-e350-b85d-b3d0-715826ce3ef6
ce480ee9-d082-8fbb-4f00-616b5ad85841
de078a00-cdc7-6586-1d28-b3ad9b18d80c
d7538d66-bae9-d5ce-4a34-12ea56b26dda
e15c834b-9bf7-cb12-80d6-ecd22210b5f6
54cb64a7-f0b7-f0e0-7143-da86c5ebb909
9005cb10-3ee1-27fb-8c9a-4ce545c28b6a
25b84f8d-d053-4fe5-5f1c-11dbc4c83129
ad66a600-3cc4-7617-eb0d-5edb146da6ed
186d37a1-46dd-ea28-f788-9cc7d60a7948
b82b5c0e-dddd-f32d-91d6-f5fcd33771ba
21150e7c-426d-edab-e2bb-b0b9475d4c67
32cff98e-4c32-177e-2c79-8eee4895a1c7
1e4873ad-34b5-a8db-5a20-564cbd9c4f6a

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