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 6167039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:26:36+00:00 2026-05-23T22:26:36+00:00

I am in a situation where I am trying to pass a value from

  • 0

I am in a situation where I am trying to pass a value from a controller action to an element directly.

The only way I know how to do this is with requestAction(), but I don’t like using that feature for resource reasons and its not recommended in the manual.

Can anyone shed some light on another method?

Here is what I have now:

Bird Controller action:

    function element_array_pass() {
    $this->paginate['Bird'] = array(
        'fields'  => array('id', 'name'),
        'contain' => array('id', 'name'),
        'order'   => 'Bird.id'
    );
    $bird_elmnt = $this->paginate('Bird');
    $this->set(compact('bird_elmnt', $bird_elmnt));
}

dir: views/elements/element_array_pass.ctp

debug($bird_elmnt); // nothing being passed here.

dir: views/birds/index.ctp

I include the element in this file, but the array will not pass.

echo $this->element('element_array_pass',array("bird_elmnt" => $bird_elmnt)); // call to element.

I would like to include this element in my index.ctp with values passed from the action() I included above.

  • 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-05-23T22:26:36+00:00Added an answer on May 23, 2026 at 10:26 pm
    echo $this->element('birds_paginator_element',array('bird_elmnt_var'=>$bird_elmnt_var));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out how to handle this situation. I have the following
This is the situation. I'm trying to provide a service where someone embedds an
I'm trying to pass an optional argument to a javascript function from jQuery. In
I'm trying to pass an id to a hidden form element and having some
Here's the situation: I am trying to launch an application, but the location of
I have code that I pass from jQuery to my ASP.Net MVC controller and
I'm trying to receive notification when the keyboard appears but I'm in a situation
Sometimes I encounter this situation in Java while trying to use immutable objects. In
Situation: I'm trying run an https store (xcart) under one domain secure.example.com and I
I am trying to create a situation where one or none of a grouping

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.