Wednesday, November 30, 2011

Re: Vendor files from Plugin folder

Hello Sam,

in my second post i figured out with pseudo names how it works at the
moment. I add the plugin vendor subfolder to the generally vendor
pathes. Now is the class via App::uses findable.
But i want only extend the plugins vendor pathes per App::build.....

On 28 Nov., 20:30, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> @millesj - if the class names are wierd/wild (or in subdir) import is easier
>
>         //App::uses('Welcome', 'Plugin/Configuration/Vendor'); # does not
> work
>         //App::import('Vendor', 'Configuration.Welcome'); # does work
>         //App::import('Vendor', 'Configuration.Welcome', array('file' =>
> 'subthing/welcome.php')); # works loads class from subdir
>         App::uses('Welcome', 'Configuration.Vendor'); # works but can't
> make it load a class from subdir of plugin
>         $welcome = new Welcome();
>         debug($welcome);
>
> @pr what is the file and class your loading?
>
>  - S
>
> On 28 November 2011 18:19, Miles J <mileswjohn...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I still just use import.
>
> > App::import('Vendor', 'PluginName.ClassName');
>
> > Also, shouldn't the uses be:
>
> > App::uses('ClassName', 'Plugin/PluginName/Vendor'); ?
>
> > On Nov 28, 12:55 am, p r <perab...@googlemail.com> wrote:
> > > have you tried this? In this case the classfile will not be found from
> > > a subfolder. You can see that with App::objects('PluginName.Vendor').
> > > Is there a way to extend the plugin vendor pathes with App::build? So
> > > i add all my subfolders and your way should be fine. Currently i go
> > > this way...
>
> > >                 App::build(array('Vendor' => array(APP . 'Plugin' . DS .
> > > 'PluginName' . DS . 'Vendor' . DS . 'SubFolder'. DS)));
> > >                 App::uses('ClassNameFromSubFolder', 'Vendor');
>
> > > On 27 Nov., 20:41, Sam Sherlock <sam.sherl...@gmail.com> wrote:
>
> > > > App::uses('ClassName', 'PluginName.Vendor');
>
> > > > App::build will let you add additional paths for plugins etc.
>
> > > > You don't need to use app build to be able to use classes from plugins.
>
> > > > - S
> > > > On 27 Nov 2011 17:55, "p r" <perab...@googlemail.com> wrote:
>
> > > > > Hello,
>
> > > > > it would be a pleasure if somebody could help me. I try to load files
> > > > > from Plugin subfolder. How should i use App::build? One solution is
> > to
> > > > > add the plugins vendor subfolder to the vendors paths. Now the
> > classes
> > > > > are available per App::uses.
> > > > > But so i have to include every external library folder i want to use
> > > > > in the plugin. Is there a way to work with plugins vendor folder in
> > > > > App::uses, or is it possible to specify this on App:build?
>
> > > > > greetings
> > > > > pr
>
> > > > > --
> > > > > Our newest site for the community: CakePHP Video Tutorials
> > > > >http://tv.cakephp.org
> > > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > > > others with their CakePHP related questions.
>
> > > > > To unsubscribe from this group, send email to
> > > > > cake-php+unsubscribe@googlegroups.com For more options, visit this
> > group
> > > > > athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

No comments: