Re: Using a full controller by other. The ultimate software design question.

2008-02-12 Thread grigri
> But just for the future, is there any article/discussion about > including controllers functions inside others? > Thats a tipical case and I wanted to read more about it. I don't think so, but I could be wrong. Here's a brief overview of your options for sharing logic between controllers: * If

Re: Using a full controller by other. The ultimate software design question.

2008-02-12 Thread MX
Man I loved that solution. Also because it gives me a global solution. Thanks! But just for the future, is there any article/discussion about including controllers functions inside others? Thats a tipical case and I wanted to read more about it. On Feb 12, 2:05 pm, grigri <[EMAIL PROTECTED]> wr

Re: Using a full controller by other. The ultimate software design question.

2008-02-12 Thread grigri
This is just an idea: app/controllers/app_controller.php class AppController extends Controller { function redirect($url, $status = null, $exit = true) { if (is_array($url)) { $url['inline'] = !empty($this->params['named']['inline']); } return parent::url($url, $status, $exi

Re: Using a full controller by other. The ultimate software design question.

2008-02-12 Thread Adam Royle
I'm not sure about anyone else, but to me you still haven't explained the big picture and what you are really trying to achieve. Cheers, Adam On Feb 12, 11:28 pm, MX <[EMAIL PROTECTED]> wrote: > I think I wrote too much and explained so little. > This is the situation: > > 3 Backend Controllers:

Re: Using a full controller by other. The ultimate software design question.

2008-02-12 Thread MX
I think I wrote too much and explained so little. This is the situation: 3 Backend Controllers: - Users - News - Images news/admin_add.ctp __ ... 'image', 'action' => 'index', 'inline' => true)> ... images_controller.php class ImagesController extend

Re: Using a full controller by other. The ultimate software design question.

2008-02-12 Thread grigri
I might be completely off here, but when I need to differentiate between popups, ajax dialogs, flash messages and "normal" pages, I use exactly the same view but change the layout. The layout also specifies what css to include so the entire look of the view can be changed without much effort. On

Re: Using a full controller by other. The ultimate software design question.

2008-02-11 Thread Adam Royle
I'm not sure I understand fully what you are trying to do, however why can't you use normal variables to determine this kind of behaviour? eg. either swap the view based on the mode, or do if/else statements in your view. Without more info (and a code example if you can) I can't really suggest an