I don't think there'd be any problem at all with using set() in another function. All it's doing is registering some view vars.
You might also want to consider putting some of your code in the model, or completely reassessing how the controller should work. On Wed, May 6, 2009 at 8:19 AM, tienzyee <[email protected]> wrote: > > Hi, > > I am new to CakePHP and I have this question (there's nothing i could > find in other post): > > I have one controller by the name radar_verbatims_controller. In the > controller there is an index function. > On the index view page, there are a few elements which communicate > with the index function directly for result (upon refreshing or > submission of data). > > My problem is, everything is crammed into index function that I think > it would be best to separate the codes into 3 functions, 1 in index > function and two more in smaller function and calling them from the > index function. > > However, since the existing code in the index function do have $this- >>set code to set the variable for index view page, if i move them into > a new function, i assume i would be breaking every single thing. I > could try to return the result into the index function upon execution > in the subfunction but I think it's gonna be a painful process. > > Is there a way for me to separate those codes into smaller > subfunctions without breaking everything in the index view page? > > I would be glad if someone can point me out. Thank you > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
