Include a view with data.

@param string $file The template you want to display
@param object $item The optional data of the current object in the loop
194926
public static function get($file, $data = [])
    {
        $path = self::load('views.' . $file);

        extract($data, EXTR_SKIP);

        include $path;
    }
418179
public function load($file) {
		$this->file = $file;

		$msg = array();
		@include($file);

		$this->msg = $msg;
	}
1301513
public function setLayout($file)
    {
        if (strstr($file, '::')) {
            $file = explode('::', $file);
            $package = $file[0];
            $file = $file[1];
        } else {
            $package = $this->package;
        }

        $this->assignDeclaredLayout($package, $file);
    }
38545
public function writeItem($item)
    {
        $this->verifyHandle();

        if ($this->autoDetectHeader && !$this->header && is_array($item)) {
            $this->header = array_keys($item);
            $this->writeItem($this->header);
        }

        $this->csv->insertOne($item);
    }
342477
public function var_dump($item)
    {
        if ($this->hasCollector('vardump')) {
            /** @var VarDumpCollector $collector */
            $collector = $this->getCollector('vardump');
            $collector->addVarDump($item);
        }
    }
131359
function render($file)
  {
    if(!file_exists(TS3WA_TPL . DS . $file) || !is_readable(TS3WA_TPL . DS . $file))
    {
      throw new Exception("Layout resource not found (" . $file . ")", 404);
    }

    require_once(TS3WA_TPL . DS . $file);
  }
945361
protected function view($file, $param=array()) {
		extract($param);
		
		if (!is_array($file)) {
			$path =  explode('\\', get_class($this));

			if (count($path) > 2) {
				$view_path = '';

				for($i=0; $i<count($path)-2; $i++) {
					$view_path .= strtolower($path[$i]).'/';
				}	

				$view_path = Config::get('path.mvc').'/'.$view_path;
			} else {
				$view_path = Config::get('path.mvc');
			}

			if (php_sapi_name() == 'cli')
				$view_path = Config::get('path.basepath').'/'.$view_path;
		} else {
			
			$view_path = Config::get('path.mvc');
			if (isset($file[1])) {
				$view_path .= '/'.$file[0];
				$file = $file[1];
			} else
				$file = $file[0];

			if (php_sapi_name() == 'cli')
				$view_path = Config::get('path.basepath').'/'.$view_path; 
			
		}
		
		ob_start();
			include $view_path.'/views/'.$file.'.php';
		return ob_get_clean();
	}
486444
public function column_file( $item ) {
		$html = '<div class="export-file">';
		$html .= $this->getIcon( $item['file'] );
		$html .= '<div class="export-file-name">' . esc_html( $item['file'] ) . '</div>';
		$html .= '</div>';

		$delete_url = sprintf( '/admin.php?page=%s&action=%s&ID=%s', $_REQUEST['page'], 'delete', $item['ID'] );
		$delete_url = get_admin_url( get_current_blog_id(), $delete_url );
		$delete_url = esc_url( add_query_arg( '_wpnonce', wp_create_nonce( 'bulk-files' ), $delete_url ) );
		$onclick = 'onclick="if ( !confirm(\'' . esc_attr( __( 'Are you sure you want to delete this export file?', 'pressbooks' ) ) . '\') ) { return false }"';
		$actions['delete'] = sprintf(
			'<a href="%s" aria-label="%s" ' . $onclick . '>%s</a>',
			$delete_url,
			/* translators: %s: file */
			esc_attr( sprintf( __( 'Delete &#8220;%s&#8221;' ), $item['file'] ) ),
			_x( 'Delete', 'verb' )
		);

		$download_url = get_admin_url( get_current_blog_id(), "/admin.php?page=pb_export&download_export_file={$item['file']}" );
		$actions['download'] = sprintf(
			'<a href="%s" aria-label="%s" >%s</a>',
			$download_url,
			/* translators: %s: file */
			esc_attr( sprintf( __( 'Download &#8220;%s&#8221;' ), $item['file'] ) ),
			_x( 'Download', 'verb' )
		);

		$html .= $this->row_actions( $actions );

		return $html;
	}
829940
private function renderItem($item)
    {
        $this->response = $this->response->withBody(stream_for($this->getRenderedItem($item)));
    }
524665
public static function partial($file, $data = [])
    {
        $path = self::load('views.partials.' . $file);

        extract($data, EXTR_SKIP);

        include $path;
    }
650598
protected function renderItem($item)
	{
		if (isset($item['url'])) {
			if($this->useSprites) {
				$spriteUrl = $this->spriteUrl;
				$item['template'] = "<a href=\"{url}\" style=\"background: no-repeat 0 {$this->itemOffset}px url($spriteUrl);\">{label}</a>";
				$this->itemOffset -= 16;
			} else {
				$components = parse_url($item['url']);
				$iconUrl = $this->iconizerBaseUrl . $components['host'];
				$item['template'] = "<a href=\"{url}\" style=\"background: no-repeat url($iconUrl)\">{label}</a>";
			}
		}
		return parent::renderItem($item);
	}
1117046
public function iGoToMenuItem(string $item)
    {
        $adminMenu = $this->admin_page->getMenu();
        $adminMenu->clickMenuItem($item);
    }
499078
public function import($file)
    {
        $data = $this->yaml->load($file);
        parent::import($data);
    }
124621
protected function add_item_label($item, $element) {
        if (strlen($item->label) && ($this->mode == self::MODE_EDIT || $this->mode == self::MODE_VIEW_TEMPLATE)) {
            $name = $element->getLabel();
            $name = '('.format_string($item->label).') '.$name;
            $element->setLabel($name);
        }
    }
437249
public function renderFile($file)
    {
        if (!is_file($file)) {
            throw new \RuntimeException(sprintf('View cannot render file "%s" does not exist', $file));
        }

        ob_start();
        ob_implicit_flush(false);

        require $file;
        return ob_get_clean();
    }
731104
public function loadFile(string $file)
    {
        $path = $this->basePath . '/' . $file . '.phtml';
        if (!is_readable($path)) {
            throw new TemplateException(sprintf('Template engine could not read the file "%s"', $path));
        };

        if (($this->contents = file_get_contents($path)) === false) {
            throw new TemplateException(sprintf('File "%s" not readable', $path));
        }

    }
641995
private function _renderItemSeparated (\stdClass $item) {
		$result = '<link rel="stylesheet"';
		if ($item->media !== 'all') $result .= ' media="' . $item->media . '"';
		if (!$item->render && self::$fileChecking) {
			$fullPath = $this->getAppRoot() . $item->path;
			if (!file_exists($fullPath)) {
				$this->log("File not found in CSS view rendering process ('$fullPath').", 'error');
			}
		}
		$result .= ' href="' . $item->href . '" />';
		return $result;
	}