Page handling - Nockiro/login-well GitHub Wiki
To create a new content page, add a file to the content/content directory, since it's included by content/content.php it has access to all php functions and extensions we create in the core/ directory.
The last thing to do would be adding an adequate page title into the core/language.php which will be displayed in the head of the page.
Example: We want a whole page only to show the current user registration count.
- Create content/content/usercount.php
- Fill it with php:
<?php echo "Current user count: " . get_usercount($mysqli); ?>
Note: Since we call a static function, you'd have to pass the variable $mysqli to all functions requiring access to the database - but: Since we can access all variables of core/, we also have the variable $mysqli and only need to pass it.
Note 2: get_usercount(..) is a function of core/functions.php, included in every page you'd create here
- Add page title to language.php:
[...] "usercount" => "Current usercount", [...]
To access your new created page, call it with yourdomain.tld/index.php?cp=your_filename
Since we try to follow a design scheme, all content should be displayed in boxes according to our stylesheet.
For that, the style sheet offers the div class "content", in which all content should lay.
For additional styleness, you can also add the class "info" or "error".
Informational content, normally shown at the top of the page, would be:
<div class="content info">
Wow, such informational content!
Will be shown in a blue (instead of the standard green background), design pattern following box with green surrounding.
</div>