-
Notifications
You must be signed in to change notification settings - Fork 2
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 #192 from kivudesign/app_view_module
App view module
- Loading branch information
Showing
11 changed files
with
163 additions
and
87 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
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
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,14 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2023. wepesi dev framework | ||
*/ | ||
|
||
namespace Wepesi\Core\Exceptions; | ||
|
||
/** | ||
* | ||
*/ | ||
class RoutingException extends WepesiException | ||
{ | ||
|
||
} |
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,11 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2024. Wepesi Dev Framework | ||
*/ | ||
|
||
namespace Wepesi\Core\Exceptions; | ||
|
||
class WepesiException extends \Exception | ||
{ | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2024. Wepesi Dev Framework | ||
*/ | ||
|
||
namespace Wepesi\Core\Views\Provider\Contract; | ||
|
||
use Wepesi\Core\MetaData; | ||
|
||
/** | ||
* | ||
*/ | ||
interface ViewsContract | ||
{ | ||
/** | ||
* Setup new folder location for layout template | ||
* @param string $folder_name | ||
* @return mixed | ||
*/ | ||
public function setFolder(string $folder_name); | ||
|
||
/** | ||
* render html content | ||
* @param string $view | ||
* @return mixed | ||
*/ | ||
public function display(string $view); | ||
|
||
/** | ||
* @param string $variable | ||
* @param mixed $value | ||
* @return mixed | ||
*/ | ||
public function assign(string $variable, $value); | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getAssignData(): array; | ||
} |
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,55 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2024. Wepesi Dev Framework | ||
*/ | ||
|
||
namespace Wepesi\Core\Views\Provider; | ||
|
||
use Wepesi\Core\Escape; | ||
|
||
class ViewBuilderProvider implements Contract\ViewsContract | ||
{ | ||
protected array $data = []; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected string $folder_name = ''; | ||
|
||
/** | ||
* @param string $folder_name | ||
* @return void | ||
*/ | ||
public function setFolder(string $folder_name) | ||
{ | ||
$this->folder_name = Escape::addSlashes($folder_name); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function display(string $view) | ||
{ | ||
// TODO: Implement display() method. | ||
} | ||
|
||
/** | ||
* assign variables data to be displayed on file_page | ||
* | ||
* @param string $variable | ||
* @param $value | ||
*/ | ||
public function assign(string $variable, $value) | ||
{ | ||
$this->data[$variable] = $value; | ||
} | ||
|
||
/** | ||
* List all data assigned before being displayed | ||
* @return array | ||
*/ | ||
public function getAssignData(): array | ||
{ | ||
return $this->data; | ||
} | ||
} |
Oops, something went wrong.