Skip to content

How to use PHP Function arguments (or input value) in dynamic get? #654

Answered by Llewellynvdm
saman222 asked this question in Q&A
Discussion options

You must be logged in to vote

You can do something like this:

Then you can have a one liner like this:

$data->getCourses($this->input->getInt('profilelook_remoteid', 0));

Reality is you can also do the following, to check your input value:

$data = new Mod*******Data();
if (($profilelook = $this->input->getInt('profilelook_remoteid', 0)) > 0)
{
	$queryKeys = 	$data->getCourses($profilelook);
}
else
{
	// no value found
	$queryKeys = 	array(1,2,3); // default options
}

Then use this query option:

These are possible ways that it can be done, really the freedom here is very powerful.

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Llewellynvdm
Comment options

Answer selected by Llewellynvdm
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Llewellynvdm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants