Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7855383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:22:06+00:00 2026-06-02T20:22:06+00:00

I’ve been trying to wrap my head around routing and for that very reason

  • 0

I’ve been trying to wrap my head around routing and for that very reason build a small aplication to fiddle around with, but i’ve managed to stumble upon a problem.

The goal of the whole test was to hide the url ‘hostname/content/index/add’ and turn it into a url more understandable for a user like ‘hostname/wms/content/add’.

But now for some odd reason i cannot redirect using the $this->url() methode. But somehow a normal link like somelink work.

I have build a few routes in the application.ini to test how it works. It’s nothing fancy…

resources.router.routes.contentroute.route = "/wms/content"
resources.router.routes.contentroute.defaults.module = content
resources.router.routes.contentroute.defaults.controller = index
resources.router.routes.contentroute.defaults.action = index

resources.router.routes.vacaturesroute.route = "/wms/vacatures"
resources.router.routes.vacaturesroute.defaults.module = vacatures
resources.router.routes.vacaturesroute.defaults.controller = index
resources.router.routes.vacaturesroute.defaults.action = index

So when i type hostname/wms/content i get redirected to the content module’s IndexController and it’s IndexAction. This works fine for all the links in my views that point to the content module like this

<a href='wms/content/'> link </a>

However it’s not working for 3 links that actually redirect towards a specific action of the IndexController on that very page hostname/wms/content.

<a href="<?php echo $this->url(array('controller'=>'index','action'=>'add'));?>">Add new content</a>

Instead of actually redirecting towards the add action in the IndexController i get redirected to hostname/wms/content, wich is the page i’m comming from.

Anyone have an idea why this is happening and possibly a way to solve this? Or am i totally approaching this the wrong way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:22:09+00:00Added an answer on June 2, 2026 at 8:22 pm

    First, your route are static ones. You should replace them with:

    resources.router.routes.contentroute.route = "/wms/content/:action/*"
    resources.router.routes.contentroute.defaults.module = content
    resources.router.routes.contentroute.defaults.controller = index
    resources.router.routes.contentroute.defaults.action = index
    

    Then, you should specify the name of your route and pass true in reset argument:

    $this->url(
      array('module'=>'content', 'controller'=>'index','action'=>'add'), 
      'contentroute', 
      true
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.