Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
Getting StartedHelpful ResourcesAsk questions on the Help ForumRead the User GuideBrowse the Reference DocumentationSubscribe to the Helix Mailing ListLearning HelixAdvanced Topics

Using Helix Modules

Every Helix site has access to hundreds of built-in objects that have been designed to accelerate development.  Those objects are grouped into one of the Helix modules along with similar objects that together make a powerful set of tools for accomplishing specific tasks.

The Helix Core module contains objects for handling the site rendering, user administration, security and lots of other useful functions.  There are lots of modules included with Helix, and many of the objects are linked between modules.  For example, there is user object in the Helix Core module that is linked to an order object in the E-Commerce module.  The code that links these objects together has already been written and is ready to use in your application.  You can use the built in functionality and even customize it to meet the needs of your project.

When objects are linked in Helix, you can access the linked objects as an array by using the object name with a '_list' after it.  See the example below to get an idea of how the built-in objects are linked to each other and the database to speed up development.

<?php
    
// Assuming you know the user_id of a user in the database,
    // construct a new user object.
    
$user = new user($user_id);
    
    
// You can loop through all of the orders that this user has
    // placed in an online store, and display the order status.
    
foreach ($user->order_list as $order)
    {
        echo 
"{$order->description}{$order->orderstatus}";
    }
?>

Customizing Helix Modules

Any built-in Helix object can be customized to meet the needs of your project.  In the example above, let's say you want the order status to always be returned in all capital letters.  You could wrap every call to $order->orderstatus in the PHP strtoupper() function, or you could customize the Helix orderstatus property.

You can customize the orderstatus property by overriding its accessor, the get_orderstatus() method on the order object.  To override the method, simply put a version of the order class in your Helix/sites/mysite/lib/final/ folder using the filename order.php.

<?php
class order extends order_ext
{
    public function 
get_orderstatus()
    {
        return 
strtoupper(parent::get_orderstatus());
    }
}
?>
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads