Skip to content

Commit

Permalink
v0.11.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
s3b4stian committed Oct 4, 2017
1 parent 4496e13 commit 308a1bb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [v0.11.0](https://github.com/linna/app/compare/v0.10.1...v0.11.0) - 2017-XX-XX
## [v0.11.0](https://github.com/linna/app/compare/v0.10.1...v0.11.0) - 2017-10-04

### Changed
* `App\Models\E404Model` renamed to `App\Models\NullModel`, use it when page do not require elaborated data
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"require": {
"php": ">=7.0.0",
"linna/framework": "^v0.20"
"linna/framework": "^v0.21"
}
}
10 changes: 10 additions & 0 deletions src/Templates/HtmlTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ public function loadJs(string $file)
$this->javascript[] = $this->cssDir.$file;
}

/**
* Set the output data.
*
* @param array $data
*/
public function setData(array $data)
{
$this->data = (object) $data;
}

/**
* Output.
*/
Expand Down
10 changes: 10 additions & 0 deletions src/Templates/JsonTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ public function __construct()
$this->data = (object) null;
}

/**
* Set the output data.
*
* @param array $data
*/
public function setData(array $data)
{
$this->data = (object) $data;
}

/**
* Return data in json format.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Views/E404View.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(NullModel $model, Authenticate $login, HtmlTemplate
parent::__construct($model);

//merge data passed from model with login information
$this->data = array_merge($this->data, ['login' => $login->logged, 'userName' => $login->data['user_name']]);
$this->data = array_merge($this->data, ['login' => $login->logged, 'userName' => $login->getLoginData()['user_name']]);

//store html template
$this->template = $htmlTemplate;
Expand Down
2 changes: 1 addition & 1 deletion src/Views/HomeView.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(HomeModel $model, Authenticate $login, HtmlTemplate
parent::__construct($model);

//merge data passed from model with login information
$this->data = array_merge($this->data, ['login' => $login->logged, 'userName' => $login->data['user_name']]);
$this->data = array_merge($this->data, ['login' => $login->islogged(), 'userName' => $login->getLoginData()['user_name']]);

//store html template
$this->template = $htmlTemplate;
Expand Down

0 comments on commit 308a1bb

Please sign in to comment.