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 .
e6690c51-bbc0-f687-5346-5388d732901c
114a8512-1096-5453-d015-5c0da9dab069
4ba1f284-8712-c6e5-cc9f-3c575bd6cdbc
39c4db82-cb8a-4035-8aa0-c31b9d2372de
5aa17020-6860-6f7d-b651-fe278ec8ec46
a59692b3-456b-6f22-c505-9f65d8796320
cf26dd4a-f2ea-6d58-a382-3b5f204328a2
8eefd096-df8c-945e-5d1d-8366ab1be909
45b93129-b097-bcf1-b410-7ac0dfd3b7d1
69c4c488-48d8-f2f3-17bb-e44d1fad733d
746f05d4-40fe-8f23-ec41-8a8eb177046d
4021f360-530a-8325-efdd-dcc0a87fe680
1ffe7a37-8caa-bd99-73fe-9fb0a4821abf
ea1c9665-f8d3-6d2f-47a2-75f5be2b8809
42a1e5dd-74c6-dde1-a6ca-6130b9469cbc
17a73102-941a-93de-a470-d6b2ed8a5ff4
a9846d80-4b5a-cce6-e0be-a3431d8f55aa
949b7e6b-3107-1770-d11f-9de02859093b
c4f712bd-a984-13da-7109-531ee3a1d455
4e1f91b9-1359-e514-cc00-4f303104fab8
ad158cf0-37c9-36d8-cb1a-a5fc762eb9f0
7418ddb9-7cf0-4ea0-c6e5-26c2500b2e9f
569628a9-fd00-3d62-efee-337be9948eca
6632e6d6-9ec5-6543-1c74-9e5851dddf40
a03c63ed-a3b2-7e47-fab0-1ac7e3c81c95
139b3829-8b7b-8db5-1601-c6dbdf8cd4bc
e6d05d0a-7c67-dfdd-15c1-6af6425ab71c
86e37ec8-12db-9524-94db-f1165dc1bf81
ed80c136-3e85-6a28-83c2-2084aaf429af
561aeb0d-2d1f-3099-5df6-4ce7ae8215ae
ecda3231-e993-5702-d6d7-6e10e8450eea
be86aa02-c854-5c8a-a6b5-7847bad142e7
c7f03118-7082-560d-28e3-a43a8d61610e
556534b3-40df-bca0-eb3d-7663ceea7e7b
38ac8110-3d4b-8729-26bc-710dc48973ad
aa82e7e7-9c65-c435-e6de-7e1dec796799
a2757226-260c-a4aa-f310-c49636f56569
ae3f9590-6361-67e0-71a2-23e68c21d4df
801f6735-f575-352e-68ef-d010d6708726
9fc68551-1cf2-32a3-90da-92a8604f66d0
2d9ab76f-4051-c76d-950f-7e25ea25474d
d56c20c0-c4d3-c840-1476-eb91356a05f3
8cec4acf-c1bb-5cf5-3577-96b0df19ddc9
d41b037e-1a1f-5378-b911-8638462084f0
6ffe6566-73a0-9763-2505-58c646d3b86c
c49b49c2-f9e3-27a3-5123-8ab82250347a
5bd1314a-9f83-bb93-843b-b0a3db1a8516
ea29ab16-fe33-f15c-9ca1-76cd9b191a37
9aef5523-cfe2-ee18-e8d4-f6cbddb7dcf2
84910bd3-89c1-bf0d-7ce0-fb8d9a99d346

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