Green
Green

Reputation: 30855

ZF2: How can I set basePath to be the same for a whole application?

The manual's example shows how to set the basePath only for some specific viewModel:

$this->getHelper('basePath')->setBasePath()

But I want to set it somewhere in one place and then it is the same for any viewModel I create in any Controller. How can I do it?

Upvotes: 1

Views: 5068

Answers (1)

AlloVince
AlloVince

Reputation: 1655

You could set a global base path in config:

'view_manager' => array(
    'base_path' => '/path/'
)

Upvotes: 10

Related Questions