AspireExplorer/includes/class-utilities.php
Namith Jawahar 3de85dff06 Initial Commit
Initial Commit
2025-02-12 23:07:42 +05:30

30 lines
734 B
PHP

<?php
/**
* The Class for Miscellaneous Helper Functions.
*
* @package aspire-explorer
*/
namespace AspireExplorer;
/**
* The Class for Miscellaneous Helper Functions.
*/
class Utilities {
/**
* Return the content of the File after processing.
*
* @param string $file File name.
* @param array $args Data to pass to the file.
*/
public static function include_file( $file, $args = [] ) {
$file_path = __DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . $file;
if ( ( '' !== $file ) && file_exists( $file_path ) ) {
//phpcs:disable
// Usage of extract() is necessary in this content to simulate templating functionality.
extract( $args );
//phpcs:enable
include $file_path;
}
}
}