hm..you are right, the thing is i want to have the "add-form" on the same page as where i show the data. is there a way to assign('add') the view.html code?
something like $objResponse->assign('add', 'innerHTML',$??view.thtml??); thanks pete On Jun 18, 8:40 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: > I wouldn't be doing it > > - Breaks MVC putting html in the controller. > - Mixing presentation with business logic is never good > - Harder to update > - DOes not allow for multiple presentation types > > On Jun 19, 12:52 pm, pete <[EMAIL PROTECTED]> wrote: > > > hi, > > im using cakex (xajax) for my project. i'm just curious if its a good > > idea to put html code inside the controller > > for example i have a ajax "addForm". > > Do you think this is a good idea to do it or is it better to have all > > html code inside a view.thtml ? > > > thanks > > > pete > > > VIEW > > <?php echo $cakex->link('Add new item', '/phases/formAdd/'); ?> > > <div id="add"></div> > > > CONTROLLER > > > function formAdd(){ > > $this->autoRender = false; > > $objResponse =& $this->Cakex->response; > > $objResponse = new xajaxResponse(); > > > $html = ' > > <form method="post" name="myform" id="myform"> > > <table border="1" width="100%" class="adminlist"> > > <tr> > > <td nowrap align="left">Last Name*</td> > > <td align="left"><input type="text" > > id="lastname" name="lastname" > > size="25">fff</td> > > </tr> > > > <tr> > > <td colspan="2" align="center"><button > > id="submitButton" onClick= > > \'...\'>Continue</button></td> > > </tr> > > </table> > > </form> ' > > $objResponse->assign('add', 'innerHTML',$html); > > > } > > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---