In module.config.php file, I have set value for 'password_has_type'. And in controller I want to access that. Here is my module.config.php file:
'auth' => array(
'password_hash_type' => 'sha512',
),
'di' => array(
'instance' => array(
'alias' => array(
'auth' => 'Auth\Controller\AuthController',
'auth_login_form' => 'Auth\Form\LoginForm',
),...
In controller
, I have used
use Auth\Module
and in Action
method I try to get access value by
echo Module::getOption('password_hash_type');
But I could not get any value?
So please can anybody help me to get that value ?
Please see my answer at Access to module config in Zend Framework 2.
But to make it more concrete to your question, you would do this:
$config = $this->getServiceLocator()->get('Config');
$pwht = $config['auth']['password_hash_type'];
I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With