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 .
a2352310-f89f-db30-788c-dd2e15285fa1
cb752343-545e-be39-94f3-caa0e2d248dc
aebe4cbe-a1ea-48fa-2636-fcab45f099d6
dfbb5880-5d1f-ef90-db2e-1fab9943de40
db21f6bf-3aed-56a7-f747-965d457882ad
b1483ef1-3714-d1c3-d443-543438a615bc
21cbacf3-982c-3888-49df-28ed22e8d707
9b7b57d8-6ca5-8bcc-aa83-fa8f2f97be1c
45b55ff0-ec29-9ece-4155-297b832d1fc1
68f4dddd-8688-e5bb-facd-695965a83e4b
6a5684bc-1154-4620-3141-a423987e16f6
2fd8c51c-4125-50f1-eae1-194529465dd7
bf845f66-e721-2215-2b4b-709d6ff82956
d4b45ee7-e8ef-9f58-dd8e-b18515ba74d2
7a84c959-f878-8857-32c8-c1739f0f9e8d
6b4498b4-c950-1f86-ffbd-f9dc935a6fed
2c40f14a-e628-ccf2-1420-142b4a0d84b4
e84841cb-73db-b4f6-6c13-32506a8a82c9
3aa4feaf-153f-8bb5-9399-d9666ae53929
8ca0540f-8c3e-fa64-78a9-e12fb3244c2f
9c6bd9bf-4b2d-c579-e632-51876acdf91f
9159535e-7d4c-ad6e-135b-fa049c9f4184
521e8587-9e70-c865-509b-fb64af55b803
2f1fca87-4fb1-e3e9-1565-49d7674a5bc6
b2ac294f-a7a9-d759-3b64-44476ca91e45
845153a4-f853-4497-932a-e2ccbb2819b9
5d6bdb93-bbf0-1c84-9dad-c1e2da960727
657ec555-d348-e739-e0bb-fc9238a99720
730e53f2-9bc5-e433-9bbd-3415cc6cf39b
e134092a-6a8b-67c4-1851-a9ae85bc825c
2fa1d48b-8de5-8070-dd05-ab016bc16492
bce6e278-f4d1-5395-1d1e-b539c4124904
4a37c759-ad7d-2d21-99aa-38b1a8dd298d
d418a7e8-8a87-9188-5a21-e6ef566bb400
a4c39704-af9d-be4f-f377-c9b37617448a
5c36cadf-1a04-bfac-660a-e0586a83a7d8
d013d3da-2aaa-345f-255f-f64be115bd40
401f755a-8c82-7d80-abe0-df507806f2fc
9925dd64-4df7-6e76-1792-b9e021d77439
4d0b13c8-e1df-791d-62af-b6886bcfa761
c5f5005d-a1aa-2976-f14a-1e00a8c05fef
8279c736-fb80-be33-be8b-55009a894345
857b5a2c-d43a-3d5f-3a26-37ac56c09aea
469fe82f-e88a-b1ff-4c59-a4a258e8de08
e302d51d-a000-aa87-e81e-44004109998e
29e2064e-3475-91c2-96fe-e31b45d2d556
9ef6aa06-f123-16d5-5861-7a74bd44db5f
7fe249e3-900e-3de0-a316-62c0bb6dfafa
6e94d033-2959-a818-d586-cb1c89c3c6ce
90d7f6e4-d49a-3e20-800b-accf58c5a59a

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