-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from Extendy/feat/115tagscloud
feat: ability to view the tags cloud on a separate page #115
- Loading branch information
Showing
9 changed files
with
538 additions
and
270 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
|
||
use App\Models\UrltagsModel; | ||
use CodeIgniter\Controller; | ||
use CodeIgniter\I18n\Time; | ||
|
||
class Urltags extends Controller | ||
{ | ||
public function __construct() | ||
{ | ||
} | ||
|
||
public function index() | ||
{ | ||
// permissions need to access this page is url.access | ||
if (! auth()->user()->can('url.access')) { | ||
return smarty_permission_error(); | ||
} | ||
|
||
$urltagsModel = new UrltagsModel(); | ||
$tags = $urltagsModel->getTagsWithUrlCount(); | ||
|
||
// Format the created_at datetime field | ||
foreach ($tags as &$tag) { | ||
// Convert to Time object | ||
$createdAt = Time::createFromFormat('Y-m-d H:i:s', $tag['created_at']); | ||
|
||
// Format as desired (e.g., 'F j, Y, g:i a') | ||
$tag['created_at'] = lang('Common.CreatedAt') . ' ' . $createdAt->format('F j, Y, g:i a'); | ||
} | ||
|
||
$data['tags'] = $tags; | ||
|
||
return view(smarty_view('url/tags'), $data); | ||
} | ||
} |
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
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
Oops, something went wrong.