Skip to content

Commit

Permalink
add customer prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Feb 14, 2018
1 parent 728d162 commit ac998f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
\PMVC\unplug('view_config_helper');

const DEBUG_KEY = 'dimension';
const PREFIX = 'prefix';

class dimension extends Action
{
Expand All @@ -34,6 +35,7 @@ function index($m, $f)
)
);
$this->_dot[dotenv\ESCAPE] = \PMVC\get($options, dotenv\ESCAPE);
$this[PREFIX] = \PMVC\get($options, PREFIX);
$allConfigs = $this->store()->getOneInputConfigs('base');

// <!-- Reset Buckets
Expand Down
2 changes: 1 addition & 1 deletion src/_store.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getOneInputConfigs( $dimension, $input=null )

private function _getOneInputFile($dimension, $input=null)
{
$file = '.dimension.'.$dimension;
$file = \PMVC\get($this->caller, PREFIX).$dimension;
if (!is_null($input)) {
$file .='.'.$input;
}
Expand Down
1 change: 1 addition & 0 deletions tests/resources/.env.dimension
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DIMENSIONS_0=test
prefix=.dimension.

foo_bar=a1
1 change: 1 addition & 0 deletions tests/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function testExtendsBase()
$c = \PMVC\plug('controller');
$c->setApp('dimension');
$c->plugApp(['../']);
$result = $c->process();
$app = \PMVC\plug(_RUN_APP);
$store = $app->store();
$actual = $store->getOneInputConfigs('another', 'v2');
Expand Down

0 comments on commit ac998f5

Please sign in to comment.