Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:44:15+00:00 2026-06-08T21:44:15+00:00

I have function public myfunction($myArray) { } I need to pass array(cat, dog) To

  • 0

I have function

public myfunction($myArray) {
}

I need to pass array("cat", "dog") To action.

$output = $this->requestAction(
    array('controller' => 'app', 'action' => 'myfunction'),
    array("cat","dog")
);

But this passes only cat to my controller action, dog wasn’t passed.

I tried this:

$output = $this->requestAction(
    array('controller' => 'app', 'action' => 'myfunction'),
    array("myArray" => array("cat","dog"))
);

But it didn’t help. I checked cookbook but couldn’t find relevant example.
How can I fix this? Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:44:17+00:00Added an answer on June 8, 2026 at 9:44 pm

    Try this code

    $this->requestAction(
        array('controller' => 'app', 'action' => 'myfunction'),
            array('pass' => array('dog','cat'))
                );
    

    in Myfunction :

    public myfunction() {
        pr($this->params->params['pass']);
    }
    

    Tell me if not working…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following in php: public function myfunction($v){ //ini_set(memory_limit,32M); $v=mysqli_real_escape_string($this->connection,$v); $stmt=mysqli_prepare($this->connection,SELECT * from
I have this function: public bool IsValidProduct(int productTypeId) { bool isValid = false; if
In the main view i have this function public function lang($file, $language){ require 'languages/'.$language.'/'.
I have the this function: @Override public List<Expense> getExpensesBetween(Date firstDate, Date secondDate) { Query
I have this function: Program A public ICollection<ReportLocationInfo> GetAllReportsInstalled() { return _Reports; } I
I have a function which implement an interface. something like this: string IMyInterface.MyFunction() {
I have an interface like Public Shared Function myfunction(Byval myvar as string, Optional ByVal
I have the following VB.NET function, for example: Public Function MyFunction (Of TData) (ByVal
Suppose I have two functions which look like this: public static void myFunction1(int a,
i have function public Menu Details(int? id) { return _dataContext.Menu.Include(ChildMenu).FirstOrDefault(m => m.MenuId == id);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.