Re: controller calling an other controller with an array as parameter
Hi wirsi, i used this in the messages_controller.php: $document= array('1', '/2007/01/01/filename.pdf', 'example'); foreach ($document as $i = $value) { $document[$i] = str_replace(/, _SLASH_, $value); } $serialized= serialize($document); $this-requestAction('documents/test/'.$serialized); And this in the documents_controller.php: function test($document) { $document= unserialize($document); foreach ($document as $i = $value) { $document[$i] = str_replace(_SLASH_,/, $value); } Thanks Klaus Schwarzkopf --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: controller calling an other controller with an array as parameter
hey ho try: $serializedscenes = serialize($scenesarray); $maplocations = $this-requestAction('locations/within/'.$m['x1'].'/'.$m['y1'].'/'.$m['x2'].'/'.$m['y2'].'/'.$serializedtypes.'/'.$serializedscenes); wirtsi On 8 Jan., 20:36, klaus1977 [EMAIL PROTECTED] wrote: Hi TJ Singleton, i know the function requestAction. But i want to know, can i call this function with an array as parameter from an other controller. $document= array('1', '/2007/01/01/filename.pdf', 'example'); function saveDocument($document){ //do something with the $document array } Klaus Schwarzkopf --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: controller calling an other controller with an array as parameter
Hi TJ Singleton, i know the function requestAction. I want to know, can i call this function with an array as parameter, like this: $document= array('1', '/2007/01/01/filename.pdf', 'example'); function saveDocument($document){ //do something with the $document array } Klaus Schwarzkopf TJSingleton schrieb: Try requestAction($url, $extra) From the Manual: This function calls a controller's action from any location and returns the rendered view. The $url is a Cake URL (/controllername/actionname/params). If the $extra array includes a 'return' key, AutoRender is automatically set to true for the controller action. http://manual.cakephp.org/chapter/controllers -- TJ Singleton --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: controller calling an other controller with an array as parameter
Hi TJ Singleton, i know the function requestAction. But i want to know, can i call this function with an array as parameter from an other controller. $document= array('1', '/2007/01/01/filename.pdf', 'example'); function saveDocument($document){ //do something with the $document array } Klaus Schwarzkopf --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
controller calling an other controller with an array as parameter
I would like to save my date with this method: function saveDocument($document){ if ($this-Document-save($document)) { $this-flash('Das Dokument wurde gespeichert.','/documents/view/'.$this-Document-getLastInsertId()); } } but i don't know, how can i calling this method from an other controller. Thank you. Klaus Schwarzkopf --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: controller calling an other controller with an array as parameter
Try requestAction($url, $extra) From the Manual: This function calls a controller's action from any location and returns the rendered view. The $url is a Cake URL (/controllername/actionname/params). If the $extra array includes a 'return' key, AutoRender is automatically set to true for the controller action. http://manual.cakephp.org/chapter/controllers -- TJ Singleton --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---