Skip to content

Commit

Permalink
Add discord_url to Welcome page model
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbennett committed Feb 11, 2019
1 parent b2bc833 commit 852337b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/controllers/Welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace BNETDocs\Controllers;

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

$model = new WelcomeModel();

$model->discord_url = Common::$config->bnetdocs->discord_url;

$view->render( $model );

$model->_responseCode = 200;
Expand Down
6 changes: 5 additions & 1 deletion src/models/Welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

use \CarlBennett\MVC\Libraries\Model;

class Welcome extends Model {}
class Welcome extends Model {

public $discord_url;

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

0 comments on commit 852337b

Please sign in to comment.