<?php
/******************************************************************************/
//                                                                            //
//                             Smarty plugin                                  //
//                            @package Smarty                                 //
//							 @subpackage plugins                              //
//                        https://life-style.uz/                               //
//                   produced by Life Style, life-style.uz                    //
//                                                                            //
/******************************************************************************/

use Mnv\Core\JSONParser\JSONFactory;

function smarty_function_yandex_metrika_new($params, &$smarty)
{
    $result = array();
    $yaMetrika = '';

    $jsonFile = new JSONFactory('JSON');
    $jsonFile->parser->loadFile(GLOBAL_ROOT . '/includes/yandex.config.json');
    try {
        $getFile = $jsonFile->parser->getField();
        if (!empty($getFile[0]['code'])) $yaMetrika = $getFile[0]['code'];
    } catch (Exception $e) {
        print_r($e->getMessage());
    }



	return $yaMetrika;

}


?>