Closed ferllings closed 3 years ago
Hi,
given a workflow Id, one option could be to directly get the list of all statuses from the workflowSource component (which wouldn't force to read a model from the DB). However this would be possible only if you're sure that MyModel
is only associated with only one workflow, and that you know the ID of this workflow.
By default the workflowSource component has name "workflowSource".
Once you have a reference to the workflowSource just call getAllStatuses (see workflowHelper for example)
Hope it helps
Thanks that works well:
$workflowSource = Yii::$app->get('workflowSource');
$allStatuses = WorkflowHelper::getAllStatusListData(
'MyWorkflow',
$workflowSource
);
Hello,
On my index page, I have a GridView widget, using an ActiveDataProvider object (from ->search() ) So I don't have any model object. So, I did a bit of 'hack' to get the full list of statues:
Is there a better way to generate the dropdown filter menu that this?
Thanks