Skip to content

Commit

Permalink
+ default license from vendor, + No license
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jun 2, 2015
1 parent 4a851f3 commit 1bfbeec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion goals/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace hidev\goals;

use Yii;
use hidev\helpers\Helper;

/**
* Goal for LICENSE
Expand All @@ -20,6 +21,6 @@ class License extends Template
{
public function getTemplate()
{
return 'licenses/' . $this->package->license . '.twig';
return 'licenses/' . Helper::id2camel($this->package->license) . '.twig';
}
}
5 changes: 5 additions & 0 deletions goals/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public function getYears()
return ($old && $old<$cur ? $this->year . '-' : '') . $cur;
}

public function getLicense()
{
return $this->getItem('license') ?: $this->vendor->license ?: 'No license';
}

public function getIssues()
{
return $this->getItem('issues') ?: ($this->source . '/issues');
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions views/licenses/NoLicense.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Copyright © {{ config.package.years }}, {{ config.vendor.titleAndHomepage }}

Please see http://choosealicense.com/licenses/no-license/

0 comments on commit 1bfbeec

Please sign in to comment.