Actions

API16

JRules/ toString

From Joomla! Documentation

< API16:JRules
Revision as of 17:34, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Magic method to convert the object to JSON string representation.

[Edit Descripton]

Description:JRules/ toString

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);
}

[Edit See Also] SeeAlso:JRules/ toString

Examples

<CodeExamplesForm />