Jump to content

Recommended Posts

Posted (edited)

<dt><a href='./something/'>Do Something</a></dt>
<dd>Runs the executeSomething() function.</dd>

How to pass some argument to the executeSomething() function?

Edited by LostKobrakai
Moved to module development
Posted

Or a hidden form on the page, that does get submitted to the target page with some post data. But that would make the data accessable/editable to users.

Posted

Hm. It seems to be not that easy. Mabey I better explain my target.

A user gets a generatet pagelist. He is ment to create a childepage. Therefore each listed page gets a link. But title and name should be given by the system and not by the user. So I cannot use the add page routine by url. Name and title should include the parent_id (which is the one slected in the list) and userid. These I originaly wanted to pass as arguments to my executefunction.

I think I cannot use a $input->get variable in that case. A $input-post variable would work, but only if I generate a lot of forms. But I would run into manipulation problems as LostKobrakai mention it is accessable/editable.

Posted

You need at least some way to identify which list item was clicked and you've only the get or post data option in this case. There's no way around that. As soon as you know that you can just create the page via the api and redirect to the page edit screen for the id of the new page. 

Posted

You mean storing the variables in the session? Same problem here: how to execute/store variable with at least the id as argument.

  • 4 months later...
Posted
	

public function ___executeSomething() {
		$this->headline('This is something!'); 
		$this->breadcrumb('../', 'Hello'); 

		$url_parameter=wire("input")->urlSegment2;

wire("input")->urlSegment2 worked for me for receiving the url data for an url like .....ModuleName/Something/UrlParameter

but in my case I had problems to encode/decode my url parameter properly, because urlencode() and base64_encode() did not work properly,

so if you know a function to do this, I would be happy..

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...