« Back to Product

Documentation

RequestAction

 void RequestAction (string $Ident, string $Value) 

Parameters

Ident

Ident of the variable

Value

The value to be set

Returns

No Return

Description

Is called when, for example, a button is clicked in the visualization.

Warning

The RequestAction function is called by IP-Symcon. It must therefore be overwritten by the base class in order to add one’s own extensions

Example

public function RequestAction($Ident, $Value) {

    switch($Ident) {
        case "TestVariable":
            // An action, e.g. switching, would normally be carried out here
            // Outputs via 'echo' are returned to the visualization
            
            // Write new value to the status variable
            SetValue($this->GetIDForIdent($Ident), $Value);
            break;
        default:
            throw new Exception("Invalid Ident");
    }
    
}
Any questions?