-
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.
2. add web/help class 3. update example 4. refactor
- Loading branch information
Showing
18 changed files
with
250 additions
and
60 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 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
<title><?=$title?></title> | ||
</head> | ||
<body> | ||
<?=$this->view->content()?> | ||
<?=$this->loadContent()?> | ||
</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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\CLI; | ||
|
||
use Exception; | ||
use Oni\Basic; | ||
use Oni\Loader; | ||
use Oni\CLI\IO; | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\CLI; | ||
|
||
use Exception; | ||
use Oni\Basic; | ||
|
||
class IO extends Basic | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\CLI; | ||
|
||
use Exception; | ||
use Oni\Basic; | ||
use Oni\CLI\IO; | ||
|
||
|
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 |
---|---|---|
|
@@ -10,8 +10,6 @@ | |
|
||
namespace Oni; | ||
|
||
use Exception; | ||
|
||
class Loader | ||
{ | ||
/** | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\Web\Controller; | ||
|
||
use Exception; | ||
use Oni\Basic; | ||
use Oni\Web\Req; | ||
use Oni\Web\Res; | ||
|
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,45 @@ | ||
<?php | ||
/** | ||
* Helper | ||
* | ||
* @package Oni | ||
* @author Scar Wu | ||
* @copyright Copyright (c) Scar Wu (https://scar.tw) | ||
* @link https://github.com/scarwu/Oni | ||
*/ | ||
|
||
namespace Oni\Web; | ||
|
||
class Helper { | ||
|
||
/** | ||
* Create Link To | ||
* | ||
* @param string $link | ||
* @param string $name | ||
* | ||
* @return string | ||
*/ | ||
public static function linkTo($link, $name) | ||
{ | ||
$link = self::linkEncode($link); | ||
|
||
return "<a href=\"{$link}\">{$name}</a>"; | ||
} | ||
|
||
/** | ||
* Link Encode | ||
* | ||
* @param string $link | ||
* | ||
* @return string | ||
*/ | ||
public static function linkEncode($link) | ||
{ | ||
$segments = explode('/', $link); | ||
$segments = array_map('rawurlencode', $segments); | ||
$link = implode('/', $segments); | ||
|
||
return $link; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\Web; | ||
|
||
use Exception; | ||
use Oni\Basic; | ||
|
||
class Model extends Basic | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\Web; | ||
|
||
use Exception; | ||
use Oni\Basic; | ||
|
||
class Router extends Basic | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\Web\Store; | ||
|
||
use Exception; | ||
use Memcached; | ||
use Oni\Basic; | ||
|
||
|
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
namespace Oni\Web\Store; | ||
|
||
use Exception; | ||
use PDO; | ||
use Oni\Basic; | ||
|
||
|
Oops, something went wrong.