public function createRelationLink($alias, $relation, $options = [])
    {
        return $this->Html->link(
            __d('crud', 'Add {0}', [Inflector::singularize(Inflector::humanize(Inflector::underscore($alias)))]),
            [
                'plugin' => $relation['plugin'],
                'controller' => $relation['controller'],
                'action' => 'add',
                '?' => [
                    $relation['foreignKey'] => $this->getViewVar('primaryKeyValue'),
                    '_redirect_url' => $this->getView()->getRequest()->getUri()->getPath()
                ]
            ],
            $options
        );
    }
public function createRelationLink($alias, $relation, $options = [])
    {
        return $this->Html->link(
            __d('crud', 'Add {0}', [Inflector::singularize(Inflector::humanize(Inflector::underscore($alias)))]),
            [
                'plugin' => $relation['plugin'],
                'controller' => $relation['controller'],
                'action' => 'add',
                '?' => [
                    $relation['foreignKey'] => $this->getViewVar('primaryKeyValue'),
                    '_redirect_url' => $this->getView()->getRequest()->getUri()->getPath()
                ]
            ],
            $options
        );
    }
public function createRelationLink ( $ alias , $ relation , $ options = [ ] ) { return $ this -> Html -> link ( __d ( 'crud' , 'Add {0}' , [ Inflector :: singularize ( Inflector :: humanize ( Inflector :: underscore ( $ alias ) ) ) ] ) , [ 'plugin' => $ relation [ 'plugin' ] , 'controller' => $ relation [ 'controller' ] , 'action' => 'add' , '?' => [ $ relation [ 'foreignKey' ] => $ this -> getViewVar ( 'primaryKeyValue' ) , '_redirect_url' => $ this -> getView ( ) -> getRequest ( ) -> getUri ( ) -> getPath ( ) ] ] , $ options ) ; }
Create relation link.

@param string $alias Model alias.
@param array $relation Relation information.
@param array $options Options array to be passed to the link function
@return string
Create relation link .