aspirecloud-plugin/includes/model/class-utilities.php
Namith Jawahar 864a5d69dc
Initial Data Population (#3)
* Assets Model and Custom Post Types defined

Assets Model and Custom Post Types defined

* Plugin Bulk Import and Clear

Plugin Bulk Import and Clear
2025-07-22 23:13:09 +05:30

32 lines
780 B
PHP

<?php
/**
* The Class for Miscellaneous Helper Functions.
*
* @package aspirecloud
* @author AspirePress
*/
namespace AspireCloud\Model;
/**
* The Class for Utility 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 = AC_PATH . DIRECTORY_SEPARATOR . 'includes' . 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;
}
}
}