: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* This class loads view page template files on the admin dashboard area.
namespace TwitterFeed\Admin;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
* Base file path of the templates
const BASE_PATH = CTF_PLUGIN_DIR . 'admin/views/';
public function __construct() {
public static function render( $file, $data = array() ) {
$file = str_replace( '.', '/', $file );
$file = self::BASE_PATH . $file . '.php';
if ( file_exists( $file ) ) {
if ( $data !== null && ! empty( $data ) ) extract( $data );