When I tried to call url
helper in a view file like below:
$url = $this->url();
The result is if:
index
and action is index
. With index is default action key, it will be only out:[base_url]\[module]
index
and action is no tindex
it will only out:[base_url]\[module]\[controller]\action
But I want the link in 1st case is:
[base_url]\[module]\index\index
How can I get it?
If you pass a param to url helper you will retrive a full url for 1st case.
For example:
in index.phtml
<?php
echo $this->url(array('test'=>'test'));
?>
It will print out:
/[root]/public/[module]/[controller]/index/test/test
The you can get index action, and you've just ignore the /test/test
<?php
$url = $this->url(array('test'=>'test'));
echo substr($url,0,-10);
?>
Output:
/[folder]/public/[module]/[controller]/index