Skip to content

Commit

Permalink
[UPD] remove contructor params that are not used often
Browse files Browse the repository at this point in the history
  • Loading branch information
bim-g committed Sep 2, 2024
1 parent 040d8ed commit ac5cb4b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Core/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ class View
*/
private string $layout_content = '';

/**
*
*/
public function __construct()
{
$this->folder_name = Application::getViewFolder();
}

/**
* @param string $js_link
*
Expand Down Expand Up @@ -95,7 +87,7 @@ public static function setMetaData(MetaData $metadata)
*/
public function setFolder(string $folder_name)
{
$this->folder_name = Escape::addSlaches($folder_name);
$this->folder_name = Escape::addSlashes($folder_name);
}

/**
Expand Down Expand Up @@ -123,8 +115,9 @@ public function display(string $view)
*/
private function buildFilePath(string $file_name): ?string
{
$folder = strlen(trim($this->folder_name)) > 0 ? $this->folder_name : Application::getViewFolder();;
$view_file = Escape::checkFileExtension($file_name);
$file_source = $this->folder_name . Escape::addSlaches($view_file);
$file_source = $folder . Escape::addSlashes($view_file);
return Application::$ROOT_DIR . '/views' . $file_source;
}

Expand Down

0 comments on commit ac5cb4b

Please sign in to comment.