# depicter/1.2.0/app/src/Front/Symbols.php

Depicter — Popup &amp; Slider Builder, version 1.2.0. 44 lines.

- Page: https://pluginprobe.com/plugins/depicter/1.2.0/code/app/src/Front/Symbols.php
- Raw: https://pluginprobe.com/plugins/depicter/1.2.0/raw/app/src/Front/Symbols.php
- Modified: 2022-08-20T06:49:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/depicter/1.2.0/code/app/src/Front/Symbols.php#L10-L20`.

```php
<?php
namespace Depicter\Front;


use Depicter\Html\Html;

class Symbols
{

    private $symbols = [];

    /**
     * Add symbol id to symbols list
     *
     * @param string $symbolID
     * @return void
     */
    public function add( $symbolID ) {
        if ( !in_array( $symbolID, $this->symbols ) ) {
	        $this->symbols[] = $symbolID;
        }
    }

	/**
	 * Render registered svg symbols
	 *
	 * @return string|\TypeRocket\Html\Html
	 */
    public function render() {
        if ( !empty( $this->symbols ) ) {
        	$symbolsContent = '';
            foreach ( $this->symbols as $key => $symbolID ) {
            	if ( file_exists( DEPICTER_PLUGIN_PATH .'/resources/scripts/svg-symbols/' . $symbolID . '.svg' ) ) {
            		$symbolsContent .= file_get_contents( DEPICTER_PLUGIN_PATH .'/resources/scripts/svg-symbols/' . $symbolID . '.svg' );
	            }
            }

            return Html::el('svg', [ 'xmlns' => "http://www.w3.org/2000/svg" ], $symbolsContent );
        }

        return '';
    }
}

```
