Thursday, August 27, 2009

Re: How to use a plugin's layout form a different plugin

You can not do this.
But you can add "beautifull_layout" to $viewPaths in bootstrap.php.
I would hack this out like:

class Pizza extend PizzaAppController {
function order() {
Configure::write('viewPaths', array_unshift(Configure::read
('viewPaths'),

APP.'plugins'.DS.'beautifull_layout'.DS.'views'.DS));
$this->layout = "pink_layout";

}

}

On Aug 27, 12:18 pm, MPeg <marco.pegor...@gmail.com> wrote:
> Hi to all.
>
> I'm developing a plugin named "pizza" and I have another plugin named
> "beautifull_layout".
> When I order a new pizza i'd like to use a layout from the
> "beautifull_layout" plugin.
>
> class Pizza extend PizzaAppController {
>   function order() {
>     $this->plugin = "beautifull_layout";
>     $this->layout = "pink_layout";
>   }
>
> }
>
> When this code is being executed I get a missing view error because
> Cake look for Pizza::order view into beautifull_layout plugin.
> I want to use  layout from different plugin but keep views and other
> things in my plugin.
>
> Thanks to all!
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: