Shopping Cart (0)

Creating simple Modules in phpVMS

Adding new modules to phpVMS is pretty easy if you know how to do it.

In this quick tutorial you’ll learn how to create a new about us page for your website without using the admin center for page creation.

For this module we will create the following 2 files:
– AboutUs.php
– aboutus.tpl

Lets start with the module file (AboutUs.php).

Create a php file, name it AboutUs.php and add the following:
AboutUs.php:

<?php class AboutUs extends CodonModule
{
public function index()
{
$this->render('aboutus.tpl');
}
}
[AdSense-C]

With this finished we now create a second file called aboutus.tpl:

aboutus.tpl:

In the aboutus.tpl file you may add anything you want. Write down some information text about your airline for example.

 

That`s it! Now the only thing we need to do is to upload it to the correct directories. You need to put the AboutUs.php file inside a folder named “AboutUs” and upload it to the modules directory. The aboutus.tpl file goes directly into your templates folder. (Note that the module is case sensitive.):

– core
— modules
— AboutUs
—- AboutUs.php

– core
— templates
aboutus.tpl

 

[AdSense-C]

To finish this tutorial create a link in your navigation menu (by default core_navigation.tpl):

<a href="<?php echo url('/aboutus'); ?>" >About Us</a>

That was pretty easy, wasn`t it? If you have any questions please comment below.