UAP 4 Documentation - BuildingaPage

Welcome to UAP Docs - BuildingaPage

Building a Page

This tutorial will explain how to build your own custom page for your UAP install. If you are new to UAP, please read MVC Explained to better understand how an MVC works before continuing.
In this tutorial we will build a Contact page. The contact page is already built into UAP, but can be easily edited.
First we will add the function called to the Home Controller located in /app/Controllers/Home.php

The above contact method does not collect any data from the user. It is set-up to just display information.

It pulls current user's information if they are logged in, and pulls stats from database for sidebar.

The Load::View Function then loads the view file to format the information collected.
This tutorial will not contain any new models. So we will save that for another tutorial.
Now we create a View. The View is located in /app/Views/Home/Contact.php

The above code is set-up to use the language file to pull data but you can just remove them and use basic html.
Now that we have the Contact files setup and ready to go, we need to let the system know they exist. Without the route set-up the page will not work because there is no way to find the files without it.

Open the Admin Panel and click System Routes. The system will check for any new Methods within all files in the Controllers folder. It also checks for new Methods within all files in Plugins Controllers folders.
If it detects a new Method, you should see a notification listing what it found. By default the Url name will be same as the detected method name. The url may be changed to whatever you like in the future.

You should now be able to open http://yoursite.com/Contact and the contact page should display.
You can edit the /app/Templates/Default/Header.php file to add a link to your Contact page. If you have any questions please use the forums below.
- Can't find what your looking for? Please use Forum.

UAP 4 Documentation - BuildingaPage

Title

Statistics

Last Reply

Forum Permissions

You cannot post in this forum.
You cannot moderate this forum.
You cannot administrate this forum.