Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
viames committed Feb 16, 2018
1 parent 4769570 commit a06991a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,8 @@ final public function getRelated($relatedProperty) {
* Extended method to return a property value of the Pair\ActiveRecord inherited object related to
* this by a ForeignKey in DB-table.
*
* @param string Related property name.
* @param string Wanted property name.
* @param string Related property name, belongs to this object.
* @param string Wanted property name, belongs to related object.
*
* @return multitype|NULL
*/
Expand Down
12 changes: 6 additions & 6 deletions src/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ public function render() {
}

// start main pagination DOM object
$render = '<div class="pagination"><ul class="pagination">';
$render = '<div class="pagination"><nav aria-label="Page navigation"><ul class="pagination">';

// left arrow for first page
if ($this->page > 1) {
$render .= '<li class="arrow"><a href="' . $route->getPageUrl(1) . '">«</a></li>';
$render .= '<li class="page-item arrow"><a class="page-link" href="' . $route->getPageUrl(1) . '">«</a></li>';
}

// calculate page range
Expand All @@ -131,20 +131,20 @@ public function render() {
for ($i=$min; $i <= $max; $i++) {

if ($i==$this->page) {
$render .= '<li class="current active"><a href="' . $route->getPageUrl($i) . '">' . $i . '</a></li>';
$render .= '<li class="page-item current active"><a class="page-link" href="' . $route->getPageUrl($i) . '">' . $i . '</a></li>';
} else {
$render .= '<li><a href="' . $route->getPageUrl($i) . '">' . $i . '</a></li>';
$render .= '<li class="page-item"><a class="page-link" href="' . $route->getPageUrl($i) . '">' . $i . '</a></li>';
}

}

// right arrow for last page
if ($this->page < $pages) {
$render .= '<li class="arrow"><a href="' . $route->getPageUrl($pages) . '">»</a></li>';
$render .= '<li class="page-item arrow"><a class="page-link" href="' . $route->getPageUrl($pages) . '">»</a></li>';
}

// close the bar
$render .= '</ul></div>';
$render .= '</ul></nav></div>';

return $render;

Expand Down
11 changes: 11 additions & 0 deletions src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,15 @@ public function getGroup() {

}

/**
* Join the user’s name and surname and return it
*
* @return string
*/
public function getFullName() {

return $this->name . ' ' . $this->surname;

}

}

0 comments on commit a06991a

Please sign in to comment.