MadelineProtoDocs/docs/docs/TEMPLATES.md

39 lines
1000 B
Markdown
Raw Normal View History

2018-04-11 14:17:45 +02:00
---
title: Web templates for `$MadelineProto->start()`
description: You get the web template used for the `$MadelineProto->start()` web UI thusly:
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
2018-04-01 13:19:25 +02:00
# Web templates for `$MadelineProto->start()`
You get the web template used for the `$MadelineProto->start()` web UI thusly:
```php
2019-10-29 22:23:35 +01:00
$template = yield $MadelineProto->getWebTemplate();
2018-04-01 13:19:25 +02:00
```
By default, it is equal to:
```html
<!DOCTYPE html>
<html>
<head>
<title>MadelineProto</title>
</head>
<body>
<h1>MadelineProto</h1>
<form method="POST">
%s
<button type="submit"/>Go</button>
</form>
<p>%s</p>
</body>
</html>
```
To modify the web template, use:
```php
2019-10-29 22:23:35 +01:00
yield $MadelineProto->setWebTemplate($new_template);
2018-04-01 13:19:25 +02:00
```
The new template must have a structure similar the the default template.
2018-04-01 13:55:07 +02:00
<a href="https://docs.madelineproto.xyz/#very-complex-and-complete-examples">Next section</a>