# CoreFramework\Helper

### Introduction

The Helper class provided in the plugin is a powerful tool designed to facilitate easy access to a list of variables and classes within the Core Framework. This class allows developers to retrieve variables and classes, making it convenient to implement Core Framework into various Wordpress plugins.

### Usage

{% code fullWidth="false" %}

```php
use CoreFramework\Helper;

if (is_plugin_active('core-framework/core-framework.php')) {
    if (class_exists('CoreFramework\Helper')) {
        $helper = new Helper(); 

        $class_names = $helper->getClassNames(); // [ 'colorStyles' => ['bg-primary', 'text-primary', 'border-primary'], 'typographyStyles' => [...], 'spacingStyles' => [...], 'layoutsStyles' => [...], 'designStyles' => [...], 'componentsStyles' => [...], 'otherStyles' => [...] ];
        $class_names = $helper->getClassNames([
            'group_by_category' => false,
        ]); // ['bg-primary', 'text-primary', 'border-primary', ...]

        $variables = $helper->getVariables(); // [ 'colorStyles' => ['primary', 'secondary'], 'typographyStyles' => [...], 'spacingStyles' => [...], 'layoutsStyles' => [...], 'designStyles' => [...], 'componentsStyles' => [...], 'otherStyles' => [...] ];
        $variables = $helper->getVariables([
            'group_by_category' => false,
        ]); // ['primary', 'secondary', ...]
    }
}
```

{% endcode %}

### Method: `$helper->`getStylesheetUrl`()`

**Since**: 1.3.3

Retrieves the full URL of the core framework stylesheet.

### Method: `$helper->`getStylesheetPath`()`

**Since**: 1.3.3

Obtains the server path to the core framework stylesheet.

### Method: `$helper->`**`getStylesheetVersion`**`()`

**Since**: 1.3.3

Fetches the version of the core framework stylesheet.

### Method: `$helper->getClassNames([options])`

**Parameters:**

* `options` (optional, array): An array of options to customise the output. The options array may contain the following keys

  <table><thead><tr><th width="227">Option</th><th width="107">Type</th><th width="91">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>group_by_category</code></td><td>boolean</td><td><code>true</code></td><td>Determines whether the returned data should be grouped by category.</td></tr><tr><td><code>excluded_keys</code></td><td>string[] </td><td><code>[]</code></td><td>An array of keys that should be excluded from the returned data. For example, to exclude all class names or variables related to colors, pass <code>['colorStyles']</code> as an element of the <code>excluded_keys</code> array. The keys can be any of the following predefined strings: 'colorStyles', 'typographyStyles', 'spacingStyles', 'layoutsStyles', 'designStyles', 'componentsStyles', 'otherStyles'.</td></tr></tbody></table>

### Method: `$helper->getVariables([options])`

**Parameters:**

* `options` (optional, array): An array of options to customise the output. The options array may contain the following keys

  <table><thead><tr><th width="227">Option</th><th width="107">Type</th><th width="91">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>group_by_category</code></td><td>boolean</td><td><code>true</code></td><td>Determines whether the returned data should be grouped by category.</td></tr><tr><td><code>excluded_keys</code></td><td>string[] </td><td><code>[]</code></td><td>An array of keys that should be excluded from the returned data. For example, to exclude all class names or variables related to colors, pass <code>['colorStyles']</code> as an element of the <code>excluded_keys</code> array. The keys can be any of the following predefined strings: 'colorStyles', 'typographyStyles', 'spacingStyles', 'layoutsStyles', 'designStyles', 'componentsStyles', 'otherStyles'.</td></tr></tbody></table>

Helper class has been introduced in version 1.2.7.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coreframework.com/development/coreframework-helper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
