# email-log/2.1.0/include/Core/UI/UILoader.php

Email Log, version 2.1.0. 72 lines.

- Page: https://pluginprobe.com/plugins/email-log/2.1.0/code/include/Core/UI/UILoader.php
- Raw: https://pluginprobe.com/plugins/email-log/2.1.0/raw/include/Core/UI/UILoader.php
- Modified: 2017-09-21T05:19:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/email-log/2.1.0/code/include/Core/UI/UILoader.php#L10-L20`.

```php
<?php namespace EmailLog\Core\UI;

use EmailLog\Core\Loadie;

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.

/**
 * Admin UI Loader.
 * Loads and initializes all admin pages and components.
 *
 * @since 2.0
 */
class UILoader implements Loadie {

	/**
	 * UI Component List.
	 *
	 * @var array
	 */
	protected $components = array();

	/**
	 * List of Admin pages.
	 *
	 * @var \EmailLog\Core\UI\Page\BasePage[]
	 */
	protected $pages = array();

	/**
	 * Load all components and setup hooks.
	 *
	 * @inheritdoc
	 */
	public function load() {
		$this->initialize_components();
		$this->initialize_pages();

		foreach ( $this->components as $component ) {
			$component->load();
		}

		foreach ( $this->pages as $page ) {
			$page->load();
		}
	}

	/**
	 * Initialize UI component Objects.
	 *
	 * This method may be overwritten in tests.
	 *
	 * @access protected
	 */
	protected function initialize_components() {
		$this->components['admin_ui_enhancer'] = new Component\AdminUIEnhancer();
		$this->components['core_settings'] = new Setting\CoreSetting();
	}

	/**
	 * Initialize Admin page Objects.
	 *
	 * This method may be overwritten in tests.
	 *
	 * @access protected
	 */
	protected function initialize_pages() {
		$this->pages['log_list_page']   = new Page\LogListPage();
		$this->pages['settings_page']   = new Page\SettingsPage();
		$this->pages['addon_list_page'] = new Page\AddonListPage();
	}
}

```
