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 .
2227e063-d8c5-f8d8-a3d0-28c72be84a14
d2d79cf7-fc60-5f15-a803-ee817be20d12
4155905d-629f-1fcd-f472-753535be18b3
7dd27706-2594-7b03-ad6e-e8aa51a56912
d6af3ca5-17f3-7c5b-3c14-774e2978d99c
9c7f32b6-acf4-d477-41b0-feba64d2c0ee
763c24dc-46de-2705-5905-484b7eed93d8
50bd6c99-1fd7-312c-8b40-2c1163bf0531
ecab1284-75fd-ac95-3ab3-e5df9e701b98
1a253fc3-c49e-3199-a030-a8e2a2b15aa2
a813b426-e586-3a00-d20a-636c2c60a508
cd8f2f04-5557-d871-6963-382096214b1a
72bb80f2-46c0-c537-7960-f8fd706b748a
11bf7f97-42d0-bda0-783f-4c698dea08fd
ceda5b5c-c8e3-c7a6-f3d8-7ba56eeabbb5
ccf6949e-d6ec-eb00-6c80-71e03271461f
31a891ac-d516-9388-d721-5fa1abe94fcc
b1ece8c6-3f64-92d4-b8c0-de876275891d
79564ea2-3894-28fd-6f8f-8e98348aa8c3
57dfc14e-59b1-2da8-5446-735ddd733188
6f09ccfa-3596-3897-21cb-dd7010a6c21d
e0b0673d-63e7-c222-3cc2-ef2de6f20117
6e215fc9-a0c8-f1e6-fe47-972eb197e9da
7fad3284-21be-de27-ef59-f6ed271b5521
cb03dfd0-cd95-8252-3e81-1ccbd991f9d2
878248f1-22d2-fdbb-8e4d-9760ca575d01
8afdf827-e746-824f-6f10-850fed383c10
a19499ff-24bc-6ab3-e124-c8a63c62ff87
bfa654a9-c96f-b020-e7ac-1465a3d75900
1eb5678a-e5d1-ccfa-32cc-fc306654f460
669541ee-e922-b345-bd56-e32f1e448474
851c51bb-9f14-223a-4143-75cbab2ab82e
43b14f0e-4e77-58ca-7094-2b029d435686
170530bf-cb07-53f1-5600-e93dbf84bf40
5cde5e7c-645a-69e6-2059-2c6bb8ce7380
27a1d0c5-52d5-3940-bfc4-ab6a923ef6de
b495a329-81ba-b535-2fec-e9c88efa097d
18770fb0-b65f-2c69-4e19-11ff2f3f6543
1942b0e3-b1ba-7978-216a-dc4ce7dbbfa4
3727bf15-f742-a57d-11b0-4f987c7f560a
a2e1f581-4f85-96f4-fe04-1949116d6871
51cb09ab-d888-16bb-2cb9-1c27a10c3a6d
483c62c0-bc59-3cd7-db88-564179ab6ef9
a9f24bd2-d124-9a6b-e897-a8c048815aad
5fd55a68-8ba0-7fdf-e17f-b259c11dc53f
98db3c00-fadf-d4b6-3a69-ea75dca6ed23
492ba84d-2a82-6715-e8f7-852c619ba5c5
2ea2b27e-ff30-7dc3-6aa3-a9ee9355057c
2db78baa-5763-c855-4bb9-49e4418cb620
c7c69071-bc04-6108-1c39-5121ac788476

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