path to singlepage
Permalink
Hello.
I have dona single page that will contain a send mail form. The thing is when i submit the form i will need the path to the singlepage so that it can reload and send the mail.
example:
<form method='post' action='kontakt.php'>
kontakt.php is my single page.
is there something similar to this i can use:
$this->getThemePath(); to get the filepath right.
thanks for any help, im really stuck..
//Bjorn
I have dona single page that will contain a send mail form. The thing is when i submit the form i will need the path to the singlepage so that it can reload and send the mail.
example:
<form method='post' action='kontakt.php'>
kontakt.php is my single page.
is there something similar to this i can use:
$this->getThemePath(); to get the filepath right.
thanks for any help, im really stuck..
//Bjorn
I guess you could use:
i cant really figure it out because $this->url('/kontakt'); only gives me
/index.php/kontakt/ and i need the filepath i guess and not the url..
//Bjorne
/index.php/kontakt/ and i need the filepath i guess and not the url..
//Bjorne
If you need to reference the page from the ACTION attribute, you need the URL and not the path. The path is used for images, CSS, JS, and so on.
I think what s/he is looking for is a built in way to get the equivalent of $_SERVER['PHP_SELF'] - I'd be interested in the same myself, as I have a block that needs to call itself; whilst PHP_SELF 'works' it produces an interesting URL prefixed by one or more /index.php/
Maybe, but you have to be careful when using PHP_SELF. Google it to see why.
Instead I would use something like:
Instead I would use something like:
<?php $url = BASE_URL."/".$this->url('/page'); ?>
<?php // $b is a block object $c = $b->getBlockCollectionObject(); ?> <a href="<?=View::url($c->getCollectionPath());?>"> Link to the page the block is displayed on </a>
If you're submitting a form from a block, you'd call:
<form method="post" action="<?=$this->action('controllerFunctionName')?>">
That has solved my minor problem. Thank you.
Thanks for your help okhayat, i got it to work.. /Bjorn