-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot inject custom formatter #111
Comments
@ThaDafinser This seems to be a general problem with injection. Here is another one I tried: 'service_manager' => array(
'factories' => [
return new \Application\Datagrid\Column\Formatter\ContractState(
$sm->get('ZfcRbac\Service\AuthorizationService')
);
]
) I tried |
As described injecting the formatter with While injecting the 'service_manager' => array(
'factories' => [
return new \Application\Datagrid\Column\Formatter\ContractState(
$sm->get('MvcTranslator')
);
]
) A problem with the |
This issue was moved to zfc-datagrid/zfc-datagrid#13 |
Though a column can use translation setting the
setTranslationEnabled()
method to true I need to translate my value inside a custom formatter.This is more of Question than an Issue.
Since this is my DI attempt I tried to inject the
viewRenderer
into my custom formatter inside mymodule.config.php
:Successfully setting the
formatter
on thecolumn
:As you can see before the DI the
formatter
was working fine.Here is the
formatter
:The setting works fine, the translation works fine. But though everything worked fine before I now get the following error:
Could not save the datagrid cache. Does the directory "/home/.../Zend/workspaces/DefaultWorkspace10/PQ2/data/ZfcDatagrid" exists and is writeable?
This actually makes no sense, right? Maybe the problem is caused by some kind of overhead or conflict with the
view
attribute. But I couldn't find any conflict inside theformatter
.Again, this is my first DI attempt. Please tell me if my approach is wrong.
Thanks
The text was updated successfully, but these errors were encountered: