Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
refactor(View): Make View extends BaseObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Aug 10, 2019
1 parent 706cc9a commit 0865cf9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
### Docs
- **template:** Add git commit hash in `CHANGELOG.md` (76bc527)

### Feat
- **ban_ips:** Store banned ip in components/Site (01084c9)

### Refactor
- **Config:** Remove params `$throw` in Config()->get() (4acfcec)
- **view:** Fix helper/username params (720f37e)


Expand Down
17 changes: 9 additions & 8 deletions framework/Http/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@

namespace Rid\Http;

use Rid\Base\BaseObject;

use League\Plates\Engine;
use League\Plates\Extension\URI;

/**
* Class View
* @author Rhilip
*/
class View
class View extends BaseObject
{

protected $templates;
/** @var Engine */
protected $_templates;

public function __construct($url = true)
public function onConstruct()
{
$this->templates = new Engine(app()->getViewPath());
if ($url) $this->templates->loadExtension(new URI(app()->request->server('path_info')));
$this->templates->loadExtension(new \Rid\View\Conversion());
$this->_templates = new Engine(app()->getViewPath());
$this->_templates->loadExtension(new \Rid\View\Conversion());
}

public function render($__template__, array $__data__ = null)
{
ob_start();
echo $this->templates->render($__template__, $__data__);
echo $this->_templates->render($__template__, $__data__);
return ob_get_clean();
}
}
4 changes: 3 additions & 1 deletion migration/ridpt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 09, 2019 at 10:44 PM
-- Generation Time: Aug 10, 2019 at 11:21 AM
-- Server version: 8.0.16
-- PHP Version: 7.3.7

Expand Down Expand Up @@ -742,9 +742,11 @@ TRUNCATE TABLE `site_config`;
--

INSERT INTO `site_config` (`name`, `value`) VALUES
('authority.apply_for_links', '5'),
('authority.invite_manual_confirm', '70'),
('authority.invite_recycle_other_pending', '90'),
('authority.invite_recycle_self_pending', '70'),
('authority.manage_links', '80'),
('authority.manage_news', '80'),
('authority.manage_subtitles', '80'),
('authority.pass_invite_interval_check', '60'),
Expand Down

0 comments on commit 0865cf9

Please sign in to comment.