Re: Multiple Paths for Models/Views/Controllers in paths.php

2007-02-23 Thread Seb

for the record... in bootstrap.php, you can use

$modelPaths
$viewPaths
$controllerPaths
$helperPaths
$componentPaths
$behaviorPaths

To add one or more paths to be looked up.

I've submitted a patch (dams simple) to add additional paths for
vendors (so that a vendor be reused across multiple projects) and I
have the weird feeling it's going to fall through the cracks! So
anyway!
The future will tell us!


On Feb 23, 2:58 pm, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> Regarding point 1 below: I was looking at loadModels(), but loadModel() has
> the same:
>
> function loadModel($name = null) {
> // ...
>
> if (!is_null($name) && !class_exists($name)) {
> $name = Inflector::underscore($name);
> $paths = Configure::getInstance();
>
> foreach($paths->modelPaths as $path) {
> if (file_exists($path . $name . '.php')) {
> // ...
> }
> }
> }
>
> }
>
> -MI
>
> ---
>
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
>
> BAKE ON!
>
> blog:http://www.MarianoIglesias.com.ar
>
> -Mensaje original-
> De: Mariano Iglesias [mailto:[EMAIL PROTECTED]
> Enviado el: Viernes, 23 de Febrero de 2007 12:54 a.m.
> Para: 'cake-php@googlegroups.com'
> Asunto: RE: Multiple Paths for Models/Views/Controllers in paths.php
>
> 1. cake/basics.php - loadModels() has this:


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



RE: Multiple Paths for Models/Views/Controllers in paths.php

2007-02-22 Thread Mariano Iglesias

Regarding point 1 below: I was looking at loadModels(), but loadModel() has
the same:

function loadModel($name = null) {
// ...

if (!is_null($name) && !class_exists($name)) {
$name = Inflector::underscore($name);
$paths = Configure::getInstance();

foreach($paths->modelPaths as $path) {
if (file_exists($path . $name . '.php')) {
// ...
}
}
}
}

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: Mariano Iglesias [mailto:[EMAIL PROTECTED] 
Enviado el: Viernes, 23 de Febrero de 2007 12:54 a.m.
Para: 'cake-php@googlegroups.com'
Asunto: RE: Multiple Paths for Models/Views/Controllers in paths.php

1. cake/basics.php - loadModels() has this:



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



RE: Multiple Paths for Models/Views/Controllers in paths.php

2007-02-22 Thread Mariano Iglesias

Try setting them on your app/config/bootstrap.php like so:

$modelPaths = array (
'/some/other/path/models' // Custom
);

// Standard model path is added automatically by Configure::
__buildModelPaths()

You get this by looking at:

1. cake/basics.php - loadModels() has this:

$path = Configure::getInstance();

// ...

foreach($path->modelPaths as $path) {
 // ...
}

2. cake/libs/configure.php - __loadBootstrap() has this:

$modelPaths = null;

// ...

require APP_PATH . 'config' . DS . 'bootstrap.php';

// ...

$_this->__buildModelPaths($modelPaths);

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Max
Enviado el: Viernes, 23 de Febrero de 2007 12:39 a.m.
Para: Cake PHP
Asunto: Multiple Paths for Models/Views/Controllers in paths.php

I've been trying to write up more complex applications with Cake.
However, I'm stuck at a place... I want Cake to load models/views/
controllers from multiple directories since the main application is
divided in various modules which are being developed individually...
Any ideas will be appreciated...


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



Re: Multiple Paths for Models/Views/Controllers in paths.php

2007-02-22 Thread Max

OOPS After looking 2 hours into core code, I just found something
from simple bootstrap.php... lol

/**
 * The settings below can be used to set additional paths to models,
views and controllers.
 * This is related to Ticket #470 (https://trac.cakephp.org/ticket/
470)
 *
 * $modelPaths = array('full path to models', 'second full path to
models', 'etc...');
 * $viewPaths = array('this path to views', 'second full path to
views', 'etc...');
 * $controllerPaths = array('this path to controllers', 'second full
path to controllers', 'etc...');
 *
 */

On Feb 22, 7:38 pm, "Max" <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> I've been trying to write up more complex applications with Cake.
> However, I'm stuck at a place... I want Cake to load models/views/
> controllers from multiple directories since the main application is
> divided in various modules which are being developed individually...
> Any ideas will be appreciated...
>
> Thanks
> Max


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