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

2009-08-27 Thread MPeg

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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



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

2009-08-27 Thread majna

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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



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

2009-08-27 Thread MPeg

But this way it couldn't be two (or more) layout with same name in
different plugins...
I might use plugins to distribute graphics and client-side
functionality... import every plugins's paths into viewPaths might
reduce system performance... do you know an alternative way to share
layout between plugins and application?

Thanks!


On Aug 27, 3:32 pm, majna majna...@gmail.com wrote:
 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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---