Server : LiteSpeed System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : alsaif ( 1057) PHP Version : 7.4.33 Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/alsaif/public_html/plugins/system/helixultimate/src/Platform/Builders/ |
<?php
/**
* @package Helix_Ultimate_Framework
* @author JoomShaper <support@joomshaper.com>
* @copyright Copyright (c) 2010 - 2021 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/
namespace HelixUltimate\Framework\Platform\Builders;
use Joomla\CMS\Filesystem\Folder;
/**
* Base builder class.
*
* @since 2.0.0
*/
class Builder
{
/**
* Constructor function for the builder class.
*
* @since 2.0.0
*/
public function __construct()
{
$this->includeFields();
}
/**
* Include all the fields from the layout path.
*
* @return void
* @since 2.0.0
*/
protected function includeFields()
{
$fields = Folder::files(HELIX_LAYOUT_PATH . '/fields', '\.php$', false, true);
if (!empty($fields))
{
foreach ($fields as $field)
{
require_once $field;
}
}
}
/**
* Render field element
*
* @param string $key
* @param array $attr
*
* @return string HTML string for the field element rendering
* @since 2.0.0
*/
public function renderFieldElement($key, $attr)
{
return \call_user_func_array(
['HelixultimateField' . ucfirst($attr['type']), 'getInput'],
[$key, $attr]
);
}
}