Skip to content

Commit 852337b

Browse files
committed
Add discord_url to Welcome page model
1 parent b2bc833 commit 852337b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/controllers/Welcome.php

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace BNETDocs\Controllers;
44

55
use \BNETDocs\Models\Welcome as WelcomeModel;
6+
use \CarlBennett\MVC\Libraries\Common;
67
use \CarlBennett\MVC\Libraries\Controller;
78
use \CarlBennett\MVC\Libraries\Router;
89
use \CarlBennett\MVC\Libraries\View;
@@ -13,6 +14,8 @@ public function &run( Router &$router, View &$view, array &$args ) {
1314

1415
$model = new WelcomeModel();
1516

17+
$model->discord_url = Common::$config->bnetdocs->discord_url;
18+
1619
$view->render( $model );
1720

1821
$model->_responseCode = 200;

src/models/Welcome.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44

55
use \CarlBennett\MVC\Libraries\Model;
66

7-
class Welcome extends Model {}
7+
class Welcome extends Model {
8+
9+
public $discord_url;
10+
11+
}

src/templates/Welcome.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require("./header.inc.phtml");
2525
<img class="welcome-logo-gnome" alt="Gnome Icon" title="Gnome Icon" src="<?php echo Common::relativeUrlToAbsolute('/a/gnome_l.gif'); ?>"/>
2626
<p>To that end, if you would like to support us, there are a few ways you can do so. You could:</p>
2727
<p><ul>
28-
<li><a href="<?php echo Common::relativeUrlToAbsolute(Common::$config->bnetdocs->discord_url); ?>">join our Discord</a> and have a chat,</li>
28+
<li><a href="<?php echo Common::relativeUrlToAbsolute($this->getContext()->discord_url); ?>">join our Discord</a> and have a chat,</li>
2929
<li><a href="<?php echo Common::relativeUrlToAbsolute('/user/register'); ?>">register</a> an account and add your knowledge to our site,</li>
3030
<li><a href="<?php echo Common::relativeUrlToAbsolute('/donate'); ?>">donate</a> to costs of running this website,</li>
3131
<li>help <a href="<?php echo Common::relativeUrlToAbsolute('https://github.com/BNETDocs/bnetdocs-web'); ?>">develop this website</a>,</li>

0 commit comments

Comments
 (0)