Please enable JavaScript to view this site.

Navigation: Advanced topics

How to add external files

Scroll Prev Next More

 

Follow the instructions below to add your files with JavaScript/CSS/PHP code to the project.

Copy your files to the project folder

Copy your files to the source folder in the project directory (e.g., ..\Documents\PHPRunnerProjects\Project1\source). Organize the files into subfolders if needed.

 

For example, you want to add images right.png and wrong.png to the images folder, a new HTML template quiz.htm to the templates folder, and a simple CSS file quiz.css. To perform this:

 

Create the folder called images inside the source folder and copy the images right.png and wrong.png there.

Create the folder called templates inside the source folder and copy the file quiz.htm there.

Copy the file quiz.css directly into the source folder.

 

When building the project, all files from the source folder are copied to the output folder while keeping the structure of the subfolders.

Link your files to pages

JavaScript

To add a link to Javascript file proceed to Style Editor -> Templates -> header.htm item and add the following code there:

 

<script type="text/javascript" src="include/customfile.js"></script>

 

This JavaScript file will be available on all pages of your application.

CSS

To add a link to Javascript file proceed to Style Editor -> Templates -> header.htm item and add the following code there:

 

<link REL="stylesheet" href="style.css" type="text/css">

 

This CSS file will be applied to all pages of your application.

PHP

It is recommended to use events to add your PHP code. Add the following code to the After table initialized event to link a PHP file to a page or After application initialized event to link a PHP file to all pages:

 

include("customfile.php");

 

Accessing PHPRunner session variables from external PHP files

If you need to access PHPRunner session variables or any PHPRunner API  from your custom file, add the following as the first line in your PHP file:

 

include("include/dbcommon.php");

 

This code snippet assumes that your external PHP file is located in the main PHPRunner folder.

 

See also:

Editor screen

Editing the <head> section

Event editor

AfterTableInit

AfterAppInit

Building a nice looking login page with Custom CSS

How to create a beautiful dashboard theme

Using CSS grid for mobile screens

Building visually appealing web applications

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software