Child pages
  • Guide to the LiveAPI System - The cpanelif() Method
Skip to end of metadata
Go to start of metadata

 

Description

The cpanelif() method is a wrapper for the cpanelif tag, which evaluates a cPanel variable or logic operator.

Example  


LiveAPI PHP Class

// Check whether a mysql error message exists.
$cpanel->cpanelif ("$CPERROR{'mysql'}");

LiveAPI Perl Module

# Check whether a mysql error message exists.
$cpliveapi->cpanelif("$CPERROR{'mysql'}");

Parameters

ParameterTypeDescriptionPossible valuesExample
conditionalstringA cPanel variable or logic operator.
  • A valid cPanel variable.
  • A logic operator.

Note:

For a full list of cPanel variables and logic operators, read our Guide to cPanel Variables.

$CPERROR{'mysql'}

Returns

This method returns a boolean value:

  • 1 — The cPanel variable or code evaluates to true.
  • 0 — The cPanel variable or code evaluates to false.