Skip to content

Commit

Permalink
1. rename
Browse files Browse the repository at this point in the history
2. refactor
  • Loading branch information
scarwu committed Feb 8, 2022
1 parent 57a68e9 commit ea738d8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions example/Web/views/main/error.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use Oni\Web\View\Helper;
use Oni\Web\Helper\HTML;
?>
<h1><?=$title?></h1>
<p>Go to <?=Helper::linkTo('/', 'home')?></p>
<p>Go to <?=HTML::linkTo('/', 'home')?></p>
5 changes: 5 additions & 0 deletions src/Oni/CLI/Helper/ANSIEscapeCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ final class ANSIEscapeCode
'brightWhite' => [ 'fg' => '97', 'bg' => '107' ]
];

/**
* Construct
*
* This function is private, so this class is singleton pattern
*/
private function __construct() {}

/**
Expand Down
15 changes: 11 additions & 4 deletions src/Oni/Web/View/Helper.php → src/Oni/Web/Helper/HTML.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
<?php
/**
* Helper
* HTML
*
* @package Oni
* @author Scar Wu
* @copyright Copyright (c) Scar Wu (https://scar.tw)
* @link https://github.com/scarwu/Oni
*/

namespace Oni\Web\View;
namespace Oni\Web\Helper;

class Helper {
class HTML
{
/**
* Construct
*
* This function is private, so this class is singleton pattern
*/
private function __construct() {}

/**
* Create Link To
* Link To
*
* @param string $link
* @param string $name
Expand Down
2 changes: 1 addition & 1 deletion src/Oni/Web/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Oni\Web;

use Oni\Basic;
use Oni\Web\Helper;
use Oni\Web\Helper\HTML;

class View extends Basic
{
Expand Down

0 comments on commit ea738d8

Please sign in to comment.