-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from fatkulnurk/dev
Dev
- Loading branch information
Showing
14 changed files
with
123 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,6 @@ class HomeController | |
{ | ||
public function welcome() | ||
{ | ||
echo "hello bro"; | ||
echo "welcome"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% include 'layouts/header.twig' %} | ||
<h1>{{ title }}</h1> | ||
<h2>{{ message }}</h2> | ||
{% include 'layouts/footer.twig' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Welcome</title> | ||
</head> | ||
<body> | ||
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
<?php | ||
namespace Fatkulnurk\Microframework\Http\Data\View; | ||
|
||
use Fatkulnurk\Microframework\App; | ||
|
||
class LexPageTemplate extends BasePageTemplate implements PageTemplate | ||
{ | ||
public function openFileTemplate() | ||
{ | ||
$this->templateString = file_get_contents($this->getLocation(). '.lex'); | ||
// $this->templateString = file_get_contents($this->getLocation(). '.lex'); | ||
$this->templateString = file_get_contents( | ||
App::getInstance()->getPath() . "./../src/views/" . $this->getLocation() | ||
); | ||
} | ||
|
||
public function getTemplateString() | ||
{ | ||
return $this->templateString; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
<?php | ||
namespace Fatkulnurk\Microframework\Http\Data\View; | ||
|
||
use Fatkulnurk\Microframework\System\Core\Exception\TemplateEngineNotFoundException; | ||
|
||
class LexRenderer implements TemplateRenderer | ||
{ | ||
public function render(string $templateString, array $arguments = []): string | ||
{ | ||
$parser = new \Lex\Parser(); | ||
$template = $parser->parse($templateString, $arguments); | ||
if (class_exists(\Lex\Parser::class)) { | ||
$parser = new \Lex\Parser(); | ||
$template = $parser->parse($templateString, $arguments); | ||
|
||
return $template; | ||
} | ||
|
||
return $template; | ||
throw new TemplateEngineNotFoundException('Lex not installed'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters