> > and the usual place to do so might be the view.
the only place if you intention is to be let the user print out the results of the model save without menu etc then you might be better off using a print stylesheet to hide the menu and other such elements - that way you can avoid the complexity of using popups you could look at using a specific plainer layout for $this->layout = 'plain'; views/layouts/plain.ctp - this plain layout does not include menu a while back I created pdf version of a resume and used a plain layout for this purpose I would personally avoid using popups as this may have a bunch of problems to solve. but if that is no good for you then one of the following either you'd have 1) the view set script to open the popup with the data (php would have to create javascript that would create popup and write ouput to it) -- or -- 2) you could save the relevant model id to session afterSave and then have the view window.open a specific action that uses this session value to display the data I would opt for the 2nd of those myself (but only if I could not avoid the popupless option) others may have a much better suggestion for you :) - S On 15 June 2010 11:28, mivogt-LU <[email protected]> wrote: > ok I see I need to explain what I aim on to get an answer fitting with > the question in mind > > 1st you are right at all. php wont open an popup, and the usual place > to do so might be the view. > > What I want to do is > if a new dataset is stored to the model, > I call the aftersave() function > from there I want to show the data stored within the process > to do a printout fitting the page > > if i do a printout within the cake site I will also have the menue be > printed > so I am looking for _any_ way to offer a PrintDataset function inside > my app. > later on I might lookup to use html2pdf lib to get it as pdf, too for > mailing it... > > if I use JS to do a popup window, will I be able to access my app data > within the window via $this-> ... or use the variable I set inside the > controller some like this:: $this->set('mydatatobeused', ($this- > >Customer->Request)); > > and do the js popup to call me a php file to show up with echo my > $mydatatobeused informations? > > thanks in advance > > michael > > On 15 Jun., 02:58, calvin <[email protected]> wrote: > > You're getting server-side/client-side code confused. PHP code runs on > > the web server, not on the visitor's web browser. It can't create pop- > > up windows in the browser. > > > > If you want to use PHP to generate JavaScript in the _view_ to pop up > > a window, then you need to do that in the view, not in the model. The > > model is only for reading/writing/manipulating your data. > > > > On Jun 14, 12:03 pm, mivogt-LU <[email protected]> wrote: > > > > > HI @ all, > > > > > I would like to know if there is a way to settle some function inside > > > my aftersave() (inside the modelcode) to open an popupwindow showing > > > the modeldate in a printable format. > > > > > I am thinking on something like > > > function aftersave() > > > { > > > doPopupwindows($this->data) > > > > > } > > > > > and inside the popup > > > > > echo $this->data->model->field; > > > > > Any suggestions on this? > > > > > Thanks > > > > > Michael > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
