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 6784505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:00:11+00:00 2026-05-26T17:00:11+00:00

I have several prefixes in play in an existing CakePHP app. I also have

  • 0

I have several prefixes in play in an existing CakePHP app. I also have a bit of primary navigation in the layout that points to shared methods. I know I can explicitly set each prefix to false to avoid linking with the prefix, but is there a shortcut path that simply tells Cake to no use any prefixes no matter which one’s context may currently exist?

For example, I’m on a page where a realtor can register (/realtor/users/register). I have a similar prefix for inspectors and contractors because the registration process is slightly different. Since I’m not authenticated, there’s a Login link in the primary nav, but the login action is shared by all user types and should be accessed without any prefix.

<?php echo $this->Html->link( 'Login', array( 'controller' => 'users', 'action' => 'login', 'realtor' => false, 'inspector' => false, 'contractor' => false ) ) ?>

I’d like to be able to, in the link, just turn off all prefixing rather than turning off each possible prefix independently. Possible?

  • 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-05-26T17:00:12+00:00Added an answer on May 26, 2026 at 5:00 pm

    If loosing the routing capabilities is not a problem for you, you could pass a string instead of an array to the link() method:

    <?php 
    echo $this->Html->link('Login', '/users/login');
    ?>
    

    EDIT

    To keep routing mechanism, here is a little Helper that would do the trick:

    class MyHtmlHelper extends HtmlHelper
    {
        public function link($title, $url = null, $options = array(), $confirmMessage = false)
        {
            $prefixes = Router::prefixes();
    
            foreach($prefixes as $prefix)
            {
                $url[$prefix] = false;
            }
    
            return parent::link($title, $url, $options, $confirmMessage);
        }
    }
    

    Off course you could change the method name if you want to keep the standard link() method. I tested this with Cake2, but this should work with Cake1.3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that uses several prefixes and, while not frequent, it's also
I have several models grouped in a module like this: #/app/models/blobs/small_text.rb class Blobs::SmallText <
I have several Jenkins parameterized jobs that uses the same parameters and parameters values.
I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on
We have several jobs that run concurrently that have to use the same config
I have several old 3.5in floppy disks that I would like to backup. My
I have several applications that are part of a suite of tools that various
I have several LINQ queries that will churn records (up to a million) based
I have several hex-values that I try to write to a file. It seems
In CakePHP, when you are using Acl/Auth, do you need to have Routing.prefixes enabled

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.