Hi Grant, It's probably wise to take a step back and look at your code with an eye on what methods you should be using. You should not be calling render in your view, or was that typo? Your message implies that you have table_contents.thtml and table_content.thtml, but I canĀ“t really make out what you have or want to achieve.
Regarding ajax and not: There is no need to create 2 views for the same method, irrespective of the contents that is obviously a duplication. Just include the requestHandler component - you then don't need to do anything to have a layout for a normal request, and not for an ajax request. Generally speaking, it's unnecessary for controller or view code to be aware of whether it's an ajax call or not when processing a request. HTH, AD7six Please note: The manual/bakery is a good place to start any quest for info. The cake search (at the time of writing) erroneously reports less/no results for the google group. The wiki may contain incorrect info - read at your own risk (it's mainly user submitted) :) You may get your answer quicker by asking on the IRC Channel (you can access it with just a browser here: http://irc.cakephp.org). On Dec 4, 4:29 am, "Grant Davies" <[EMAIL PROTECTED]> wrote: > Hi guys, > > I have a view where I need to render the same content when its an ajax > call another time when its first page render. I don't want a duplicate > of the table_contents.thtml file even if its uses elements to create > itself. So in the table_content.html view file has : > > <div id='table_content'> > $this->render("table_contents"); > </div> > > and in the controller when I do an ajax update I do : > > $this->render('table_contents', 'ajax'); > > the issue is when you render a view inside a page causes it to render > the view with its layout so it closes the html tag and the body tag at > the end of the render call, and anything after is techinically invalid > since the html tag has been closed. So my initial page render is > actually wrong due to the table_contents being a view file and not an > element file. > > I know you can use elements for "content" which I do to actually create > the details of the table_contents.thml but when the page loaded the > first time its table_content div is the same as when its called from > ajax and I hate having a duplicate view thml file. > > Cheers > Grant > > ...........................................> b l u e t u b e i n t e r a c t > i v e..: grant davies > .: 404.428.6839 (c) > .: 708-983-1577 (F) > > > [EMAIL PROTECTED] > >http://www.bluetube.com/bti<http://www.bluetube.com/bti> > > A Tribal Chicken Designs Affiliate <http://www.tribalchicken.com/> > > small.jpg > 2KViewDownload --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---