Actions

API16

JRules/ toString

< API16:JRules

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Magic method to convert the object to JSON string representation.



Syntax

__toString()


Returns

string

Defined in

libraries/joomla/access/rules.php

Importing

jimport( 'joomla.access.rules' );

Source Body

public function __toString()
{
        $temp = array();
        foreach ($this->_data as $name => $rule)
        {
                // Convert the action to JSON, then back into an array otherwise
                // re-encoding will quote the JSON for the identities in the action.
                $temp[$name] = json_decode((string) $rule);
        }
        return json_encode($temp);
}



Examples

Code Examples


Advertisement