Re: Bad Design? Using another controller's view

2009-05-11 Thread brian

On Mon, May 11, 2009 at 4:04 PM, brian  wrote:
> On Mon, May 11, 2009 at 1:00 PM, jwerd  wrote:
>>
>> And this is considered good design in that sense?
>
> As I said, I didn't really understand why you want to render another
> controller's view.

Sorry, I should have clarified that not understanding exactly what
you're doing keeps me from commenting on whether it's good design or
not.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bad Design? Using another controller's view

2009-05-11 Thread brian

On Mon, May 11, 2009 at 1:00 PM, jwerd  wrote:
>
> And this is considered good design in that sense?

As I said, I didn't really understand why you want to render another
controller's view. Using render() works but your overall scheme might
not be the best approach.

As Gonzalo mentioned, you might also want to consider using an element.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bad Design? Using another controller's view

2009-05-11 Thread Gonzalo Servat
On Mon, May 11, 2009 at 2:00 PM, jwerd  wrote:

>
> And this is considered good design in that sense?
>
> On May 11, 10:41 am, brian  wrote:
> > I'm not sure I follow all that but it seems like what you want to do
> > can be accomplished like so:
> >
> > $this->render('contents_comments/the_view_you_want');
>

What about using elements?

- Gonzalo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bad Design? Using another controller's view

2009-05-11 Thread jwerd

And this is considered good design in that sense?

On May 11, 10:41 am, brian  wrote:
> I'm not sure I follow all that but it seems like what you want to do
> can be accomplished like so:
>
> $this->render('contents_comments/the_view_you_want');
>
> On Mon, May 11, 2009 at 12:14 PM, jwerd  wrote:
>
> > I don't know if this is very practical or if it's bad design, but I
> > have a scenario where I need to use another controller's view in a
> > seperate controller, but I want all the automagicness, all the
> > formatting, etc...
>
> > Basically, I'll give you the real world example:
>
> > I have a video display page, and I want users to be able to comment on
> > a certain video.
>
> > I've set up two controllers to accomplish this:
>
> > contents (where the videos are stored)
> > contents_comments (where the comments for those videos are stored)
>
> > I want to be able to use a view from contents_comments in contents/
> > view/#video_id#/ so the user can add a comment and it's sent via ajax.
>
> > is there a practical design or good design habit any of you have used?
>
> > Thanks in advanced.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bad Design? Using another controller's view

2009-05-11 Thread brian

I'm not sure I follow all that but it seems like what you want to do
can be accomplished like so:

$this->render('contents_comments/the_view_you_want');

On Mon, May 11, 2009 at 12:14 PM, jwerd  wrote:
>
> I don't know if this is very practical or if it's bad design, but I
> have a scenario where I need to use another controller's view in a
> seperate controller, but I want all the automagicness, all the
> formatting, etc...
>
> Basically, I'll give you the real world example:
>
> I have a video display page, and I want users to be able to comment on
> a certain video.
>
> I've set up two controllers to accomplish this:
>
> contents (where the videos are stored)
> contents_comments (where the comments for those videos are stored)
>
> I want to be able to use a view from contents_comments in contents/
> view/#video_id#/ so the user can add a comment and it's sent via ajax.
>
> is there a practical design or good design habit any of you have used?
>
> Thanks in advanced.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bad Design? Using another controller's view

2009-05-11 Thread jwerd

It won't let me edit my post so I'm going to add some more details
below.

Essentially what I'm trying to accomplish (without the use of ugly
iframe hackery) is to be able to (via ajax) use another controller's
view within my video controller that will still apply the model's
validation, etc...  I just want to see how you are accomplishing this
or if it's just crazy :)

Thanks mucho

On May 11, 10:14 am, jwerd  wrote:
> I don't know if this is very practical or if it's bad design, but I
> have a scenario where I need to use another controller's view in a
> seperate controller, but I want all the automagicness, all the
> formatting, etc...
>
> Basically, I'll give you the real world example:
>
> I have a video display page, and I want users to be able to comment on
> a certain video.
>
> I've set up two controllers to accomplish this:
>
> contents (where the videos are stored)
> contents_comments (where the comments for those videos are stored)
>
> I want to be able to use a view from contents_comments in contents/
> view/#video_id#/ so the user can add a comment and it's sent via ajax.
>
> is there a practical design or good design habit any of you have used?
>
> Thanks in advanced.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Bad Design? Using another controller's view

2009-05-11 Thread jwerd

I don't know if this is very practical or if it's bad design, but I
have a scenario where I need to use another controller's view in a
seperate controller, but I want all the automagicness, all the
formatting, etc...

Basically, I'll give you the real world example:

I have a video display page, and I want users to be able to comment on
a certain video.

I've set up two controllers to accomplish this:

contents (where the videos are stored)
contents_comments (where the comments for those videos are stored)

I want to be able to use a view from contents_comments in contents/
view/#video_id#/ so the user can add a comment and it's sent via ajax.

is there a practical design or good design habit any of you have used?

Thanks in advanced.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---