Show atomium view.

@param string $file
@param array  $data

@return string
181618
protected function atomium($file, $data, $nest = null)
    {
        $atomium = new Atomium($nest);

        return $atomium->show($file, $data);
    }
117620
public static function find(String $file, String $data) : stdClass
    {
        $contents = self::read($file);
        $index    = strpos($contents, $data);

        return (object)
        [
            'index'    => $index,
            'contents' => $contents
        ];
    }
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();
	}
414130
public static function read($file)
    {
        if (!is_readable($file) || !is_file($file)) {
            return;
        }

        $data = file_get_contents($file);

        if ($data === false) {
            return;
        }

        return $data;
    }
544719
public function withTag($file)
    {
        $extension = pathinfo($file, PATHINFO_EXTENSION);

        try {
            $manifest = $this->readManifestFile();
        } catch (\Exception $e) {
            return $file;
        }

        // if no manifest, return the regular asset
        if (!$manifest) {
            if ($extension == 'js') {
                return '<script src="' . $this->buildPath . '/' . $file . '"></script>';
            }

            return '<link rel="stylesheet" href="' . $file . '">';
        }

        if ($extension == 'js') {
            return '<script src="' . $this->buildPath . '/' . $manifest[$file] . '"></script>';
        }

        return '<link rel="stylesheet" href="' . $this->buildPath . '/' . $manifest[$file] . '">';
    }
437875
public function render($file, $data) {
        $template = $this->engine->loadTemplate($file);

        return $template->render($data);
    }
194926
public static function get($file, $data = [])
    {
        $path = self::load('views.' . $file);

        extract($data, EXTR_SKIP);

        include $path;
    }
1139285
public function render($viewFile, $data = [])
    {
        return $this->builder
            ->getView()
            ->start($this->request, $this->response)
            ->renderContents($viewFile, $data);
    }
1251869
protected function viewText($file, $controller)
    {
        $data = array(
            'file' => $file,
            'content' => file_get_contents($file->getRealPath())
        );

        return $controller->render('file_manager|readers/text', $data);
    }
733408
public function preview(File $file)
    {
        $bbcode = $this->bbcode();

        return preg_replace_callback_array([
            '/\](?<find>.*)\[/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->base_name, $m[0]);
            },
            '/size=(?<find>{.*?})/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->humanSize, $m[0]);
            },
            '/uuid=(?<find>{.*?})/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->uuid, $m[0]);
            },
            '/url=(?<find>{.*?})/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->url, $m[0]);
            },
        ], $bbcode);
    }
945789
public function dump($file, array $data)
    {
        $dir = dirname($file);

        if (!is_dir($dir)) {
            mkdir($dir, 0755, true);
        }

        $fileInfo = new SplFileInfo($file);

        if ($fileInfo->isFile()) {
            if ($fileInfo->isWritable()) {
                $fileObject = $fileInfo->openFile('w');
            } else {
                throw new Exception(sprintf('File "%s" is not writable.', $file));
            }
        } else {
            $fileObject = $fileInfo->openFile('w');
        }

        if (null !== $fileObject->fwrite('<?php return ' . var_export($data, true) . ';')) {
            return true;
        }

        return false;
    }
702323
private function make_data($file)
  {
    if (!array_key_exists('template', $file)) {
      throw new Exception('x> Current page: ' . $file['title'] . ' does not have a template.');
    }

    $t = Application::templates()->template($file['template']);

    $tmpl = $file;
    $tmpl['slug'] = $this->make_slug($file, $tmpl);

    $data_folder = Application::data_folder();
    $template_name = $data_folder . '/templates/' . $t;
    $content_template = $data_folder . '/' . $file['content'];

    $render_content_with = Application::renders()->select($content_template);
    $render_with = Application::renders()->select($template_name);

    $tmpl['html'] = $render_with->render($template_name, [
      'content' => $render_content_with->render($content_template, [
        'post'=> $file,
      ]),
      'post'=> $file,
    ]);

    if ($this->is_index($file['file'])) {
      $this->log_current_page('index', '');
    } else {
      $this->log_current_page($file['title'], $tmpl['slug']);
    }

    return $tmpl;
  }
1141410
public function partial($file, array $variables = array())
    {
        extract($variables);

        if (substr($file, -4) !== '.php') {
            $file .= '.php';
        }

        $view = '';

        if ($tmpl = locate_template($file)) {
            ob_start();
            include($tmpl);
            $view = ob_get_contents();
            ob_end_clean();
        }

        return $view;
    }
764597
public static function view(string $view, array $data = [])
  {
    $global = Self::$variables::get();
    $data = array_merge($global, $data);

    return Self::$view->view($view, $data);
  }
990425
private static function parse($file, $data)
    {
        $file = file_get_contents($file, FILE_USE_INCLUDE_PATH);

        // Go through each variable and replace the values
        foreach($data as $key => $value)
        {
            $pattern = '{{{' . $key . '}}}';
            $file = preg_replace($pattern, $value, $file);
        }

        if(!!$file)
        {
            return $file;
        }

        return false;
    }
895146
public function render($fileName, $data = [])
    {
        $content = $this->renderParticle($fileName, $data);
        if ($this->layout) {
            ob_start();
            ob_implicit_flush(false);
            $layout = $this->getLayoutPath();
            require $layout;
            return ob_get_clean();
        } else {
            return $content;
        }
    }
340019
protected function saveFile($file, array $data)
    {
        $path = $this->getVendorDir() . '/' . $file;
        if (!file_exists(dirname($path))) {
            mkdir(dirname($path), 0777, true);
        }
        $array = str_replace("'" . self::BASE_DIR_SAMPLE, '$baseDir . \'', Helper::exportVar($data));
        file_put_contents($path, "<?php\n\n\$baseDir = dirname(dirname(__DIR__));\n\nreturn $array;\n");
    }