Child pages
  • cPanel API 1 Functions - Branding::file
Skip to end of metadata
Go to start of metadata

 

Description

This function searches for a file within a theme and returns its URL.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Examples


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$branding_file = $cpanel->api1('Branding', 'file', array('mythemes', '/0', 'my_theme', '1', '0', '0' '1') ); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $branding_file = $cpliveapi->api1('Branding', file, ['mythemes', '/0', 'my_theme', '1', '0', '0', '1'] ); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Branding::file( $FORM( 'file','isvar','pkg','inline', 'needfile','skipdefault','checkmain') )">
 Command Line
cpapi1 --user=username Branding file mythemes 0 my_theme 1 0 0 1


Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the cpapi1 command:

    /usr/local/cpanel/bin/cpapi1

 Output (URL)
/cPanel_magic_revision_1267840609/branding/contactinfo_include.html 

 

Parameters

ParameterTypeDescriptionPossible valuesExample
filestring

Required

The file's name.

Any valid filename.mythemes
isvarBoolean

Required  

This is a legacy parameter.

 

 

  • 0
  • null

Warning:

Always set this value to 0 or null.

0
pkgstring

Required  

The style for which to search.

Any valid style name.my_theme
inlineBoolean

Required  

Whether to print the file's contents.

  • 1 — Print the file's contents.
  • 0 — Do not print the file's contents.
1
needfileBoolean

Required

This is a legacy parameter.

 

  • 0
  • null

Warning:

Always set this value to 0 or null.

0
skipdefaultBoolean

Required

This is a legacy parameter.

 

  • 0
  • null

Warning:

Always set this value to 0 or null.

0
checkmainBoolean

Required

Whether the function should search the account's /cpanelbranding directory.

  • 1 — Search the directory.
  • 0 — Do not search the directory.
1

Returns

This function's output depends on the values of the input parameters.