0

got a bit of a problem with Zend not adding the base url into routes i think.

What i have is as follows:

application
    modules
        menu

public
    menu
        css
        js
        index.php

    index.base.php

I am using the function

<?php echo $this->url(array('module' => 'module1'), 'menu-install'); ?>

With the route:

$router->addRoute('menu-install', new Zend_Controller_Router_Route('/install/:modulePath', array('module' => 'menu', 'controller' => 'install', 'action' => 'install')));

Which is outputting http://menu/install/module1/ instead of http://localhost:8888/menu/install/module1/

Any ideas whats going on?

2
  • Can you give the route definition for "menu-install" ? Commented Mar 7, 2011 at 14:52
  • Sorry forgot to add it, added it now. Commented Mar 7, 2011 at 14:56

2 Answers 2

1

Try ro write this(in bootstrap for example)

Zend_Controller_Front::getInstance()->setBaseUrl('/');
Sign up to request clarification or add additional context in comments.

1 Comment

If i add in the following it seems to work $front->setBaseUrl('/localhost:8888/' . CURRENT_MODULE . '/');
1

Normally, the URL View Helper return only the URI after the without the domain ; than

 <?php echo $this->url(array('module' => 'module1'), 'menu-install'); ?>

Write something like this:

 /menu/install/module1/

Where:

  1. /menu is your "BaseURL" (.htaccess)
  2. /install/* is your route content

Perhaps, you have write "http://" before the ?

An other possibility is that you have a mistake with your parameters "module" and the "Module" mechanics of Zend_Framework...

Aka

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.