Guide to the LiveAPI System - The cpanelif() Method

Description

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

Example  


LiveAPI PHP Class

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




LiveAPI Perl Module

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



Parameters

 Parameter 

Type

Description

Possible values

Example

conditional

 string 

 A 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.
  • 86 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....