We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

parse_variables not returning {switch} and other default variables

Development and Programming

Philip Zaengle's avatar
Philip Zaengle
293 posts
15 years ago
Philip Zaengle's avatar Philip Zaengle

I have a plugin that’s grabbing an array and mapping the values to variables that can be output on demand. EVerything working find in the plugin itself, but the automatic variables like switch, count and total_count arn’t working. They are just printed to the screen when I try and include them.

Here’s the code:

$count = 0;
        $output = '';
    
        if (isset($results['list'])){
            print_r("The Query Worked");
        
            foreach($results['matching_chapar'] as $row){
                $variable_row = array(
                    'name'        => $row['name'],
                    'phone'        => $row['phone'],
                    'email'        => $row['email'],
                    'url'            => $row['url'],
                    'address' => $row['address']
                    );
                
                $output .= $this->EE->TMPL->parse_variables_row($tagdata, $variable_row);
            }
        }
        else{
            $output = "Query Failed";
        }
        
        
        return $output;
       
the3mus1can's avatar
the3mus1can
426 posts
15 years ago
the3mus1can's avatar the3mus1can

You probably want to use parse_variables and not parse_variable_row.

       
Philip Zaengle's avatar
Philip Zaengle
293 posts
15 years ago
Philip Zaengle's avatar Philip Zaengle

Wow, cant believe I missed that. Thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.