Possible bug in component factories
Notice: This thread is very old.
- Blujacker
- Member | 89
While using Nette to create components using auto-generated factories, I ran into error that custom parameters (not sure how to call them, they're defined in neon file in parameters section) are not correctly passed.
In my neon, I have something like:
parameters:
host: "mujHost"
services:
- App\Components\TestComponentFactory(%host%)
and the component's code is:
<?php
namespace App\Components;
interface TestControlFactory{
/** @return TestControl */
public function create();
}
class TestControl extends \Nette\Application\UI\Control{
private $host;
private $database;
function __construct($host, \Nette\Database\Context $database){
parent::__construct();
$this->host = $host;
$this->database = $database;
}
}
The error that I am getting is Class mujHost used in service ‘105_APP_Components_TestControlFactory’ not found or is not instantiable.
Is it a bug in Nette or am I doing something wrong?
Thanks!