You're definitely right. thanks a lot. I should think about it every time I see something recurrent in my code.

Jon Bennett wrote:
Any thoughts ??
    

how about adding this function to your app_controller.php

function getSelectedItems ($data)
	{
		$return = array();
		foreach ($data as $row)
		{
			$return[$row['id']] = $row['name'];
		}
		return $return;
	}

then you can use:

$this->set('selected_categories', $this->getSelectedItems
($this->params['data']['ProductCategory']));

hth

jon

  


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

Reply via email to