Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Slash at the end of a link - Problem with Zend\View\Helper\Url #130

Open
mano87 opened this issue Aug 7, 2017 · 1 comment
Open

Slash at the end of a link - Problem with Zend\View\Helper\Url #130

mano87 opened this issue Aug 7, 2017 · 1 comment

Comments

@mano87
Copy link

mano87 commented Aug 7, 2017

Hello,
i have integrated two links into a template as follows.

<div class="btn-group" role="group">
    <a class="btn btn-default <?php echo ($this->url() == '/education/student-deregistration') ? 'active' : ''; ?>" href="<?php echo $this->url('education.student-deregistration', ['section' => null]); ?>">Vorklinik</a>
    <a class="btn btn-default <?php echo ($this->url() == '/education/student-deregistration/clinical') ? 'active' : ''; ?>" href="<?php echo $this->url('education.student-deregistration', ['section' => 'clinical']); ?>">Klinik</a>
</div>

And This is my route.

class RouterDelegatorFactory implements DelegatorFactoryInterface
{
    public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null)
    {
        $application = $callback();
        $application->route('/education/student-deregistration[/{section:clinical|preclinical}]', StudentDeregistrationAction::class, ['GET'], 'education.student-deregistration');
        return $application;
    }
}

Now I have the following problems:

  1. With this configuration the link /education/student-deregistration is always output with a / at the end. This is not work. What can i do?
  2. Is there a more elegant way to check the active link?

@weierophinney @RalfEggert

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-view; a new issue has been opened at laminas/laminas-view#11.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants