I just figured it out. I removed the 'admin' => 1 from the route and
the 'admin_' from the view filename and it worked. Like a charm, in
fact.

But, if anyone knows how to get an iframe to load an admin view, I'd
love to know.

On Wed, Feb 11, 2009 at 5:19 PM, brian <[email protected]> wrote:
> Can someone point out the (I'm sure) obvious thing I'm missing to get
> a view to load in an iframe?
>
> I'm trying to create an interface to SwiftMailerComponent which has
> batch sending capabilities. It can also print out a progressive list
> of recipients and whether the message was successfully sent or not.
> This is handy in case the batch fails for some reason--the list of
> successful recipients up until that point will be printed out already.
>
> So, what I'm trying to do is to load the message form inside of an
> iframe so that the submit won't refresh the page and SwiftMailer's
> progressive output can be received. I have to use an iframe because
> ajax won't deal with the progressive output (correct me if I'm wrong).
>
> The situation looks like this:
>
> admin.ctp [ layout ]
>  admin_contact.ctp [ action view ]
>    iframe [ url: /admin/members/contactForm ]
>      admin_contact_form.ctp [ form view ]
>
>
> There's also a 'contact_form' layout, which is just a basic wrapper to
> complete the form HTML page.
>
> admin_contact.ctp contains:
> <iframe name="contact_frame" id="contact_frame" src="<?=
> Router::url(array('controller' => 'members', 'action' =>
> 'contactForm', 'admin' => 1), true) ?>" width="100%"
> height="600"></iframe>
>
> The created url looks good.
>
> In MembersController, I have an admin_contact() method to deal with
> sending the message. When there's no data, it simply renders the main
> view.
>
> The only way I could think to get the iframe contents rendered was to do this:
>
> public function admin_contactForm()
> {
>        $this->layout = 'contact_form';
>        $this->render('admin_contact_form');
> }
>
> But I'm not seeing anything, including the layout contents. I stuck a
> Debugger::log in there but not a peep. And no errors, either.
>
> And, if anyone can think of a better way (anything that works,
> actually) I'm all ears.
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to