I have a weird issue that I am sure is something simple I am missing.  I am
trying to create a "related tag" page much like the snipeet application
uses.  In fact most of the code I am using is from the snipeet application.

To do this I take all the tags and push them to an array using the explode
function, then on the template page I will use the implode function.

  public function executeShow()
  {
      $this->keyword = $this->getRequestParameter('keyword');
    $this->mkeywords = explode(' ', $this->getRequestParameter('keyword'));
     echo is_array($this->mkeywords) ? 'Array' : 'not an Array';

      //$this->exclude_keywords = explode(' ',
$this->getRequestParameter('keyword'));
    $this->recipes = RecipePeer::getRecipesByKeyword($this->keyword);

//$this->associated_keywords=RecipeKeywordPeer::getAssiocatedKeywords($this->recipes,
$this->mkeywords);
  }

In the executeShow function, mkeywords is an array, to make sure I was not
going insane I added the echo statement just to make sure. Please ignore all
the sloppiness I was trying a lot of stuff.

Now when I get to the ShowSuccess.php template I try to implode $mkeywords
and I get an error about implode not being used properly.  So I check using
is_array(mkeywords) and it is not an array.  Using is_object(mkeywords) says
it is an object.

How does this go from being an array in the action to an object in the
template?

<?php echo is_object($mkeywords) ? 'Object' : 'not an object';?>

<br />
<h3><?php echo "Recipes with keyword ".$keyword?></h3>
<br />
<?php echo include_partial('recipe/list', array('recipes' => $recipes))?>

the print_r output of mkeywords

ObjectsfOutputEscaperArrayDecorator Object ( [count:private] =>
[value:protected] => Array ( [0] => christmas ) [escapingMethod:protected]
=> esc_entities )

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to