Q:

Phalcon php pass parameter in constructor

I would like to pass parameter to constructor in controller.  Is it possible to do ? 
I am trying to pass interface defination in constructor. 
or is it possible to bind or set constructor in DI ? 
below is my code. 
<? php

use Phalcon\Repositories\IUsersRepository;

class UsersController extends ControllerBase
{
    private  $users;

    public function __construct(IUsersRepository $usersRepository)
    {
        $this->users = $usersRepository;
    }
? >

A:

I have fixed by using below code in service.php
$di->set('usersRepository', array(
    'className' => 'Phalcon\Repositories\UsersRepository'
));

$di->set('UsersController', array(
    'className' => 'UsersController',
    'arguments' => array(
        array('type' => 'service', 'name' => 'usersRepository')
    )
));

