Problème paginator version 1.3

2011-12-27 Thread Sabri
Salut pour tous,
j'ai un problème Notice (8): Undefined variable: paginator [APP\View
\posts\index.ctp, line 2]
( ! ) Fatal error: Call to a member function numbers() on a non-object
in C:\wamp\www\concours\cake_1_3\app\View\posts\index.ctp on line 2


View/index.ctp
 numbers();
debug($articles);
?>

Controller/posts-controllers.php
array(
'limit' => 2,
'order' => array(
'Post.created' => 'Desc'
)
));

function index() {
 $q = $this->paginate('Post');
 $this->set('articles',$q);
}
}
?>

Model/post.php et category.php





Des solutions SVP?

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


Re: IBM DB2 and CakePHP

2010-06-17 Thread Kareem Sabri
Has cake dropped native support for DB2 in version 1.3?

On Jun 17, 12:38 pm, Kareem Sabri  wrote:
> Upon checking the dbo_db2.php doesn't exist - ie. no driver. Nor odbc.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: IBM DB2 and CakePHP

2010-06-17 Thread Kareem Sabri
Upon checking the dbo_db2.php doesn't exist - ie. no driver. Nor odbc.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


IBM DB2 and CakePHP

2010-06-17 Thread Kareem Sabri
Hello,

I get the following message when attempting to connect to DB2

Your database configuration file is present.


Fatal error: Call to a member function isConnected() on a non-object
in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
\uigr2\cake\libs\view\pages\home.ctp on line 84

I have the datasource registered as a System DNS and can successfully
connect outside of cake with:

$dbconn = db2_connect($dbname, $username, $password);

I have tried both of these configurations:

var $default = array(
'driver' => 'odbc',
'persistent' => false,
'host' => 'localhost',
'login' => 'mdstest',
'password' => 'xxx',
'database' => 'UIGR_DB',
'prefix' => '',
'schema' => 'MDSTEST',
'encoding' => 'utf8',
);

var $default = array(
'driver' => 'db2',
'persistent' => false,
'host' => 'localhost',
'login' => 'mdstest',
'password' => 'xxx',
'database' => 'UIGR_DB',
'prefix' => '',
'schema' => 'MDSTEST',
'encoding' => 'utf8',
);

Any advice?

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Hundreds of empty rows being created

2010-06-03 Thread Kareem Sabri
Hello,

I have a very weird issue. As the subject line says, in one of my
models I get empty rows being inserted into the database.

I've put some logging into beforeSave() and haven't been able to get
too much info. I saw records being saved with ID NULL - which I
believe is how it should be when create() is called since the database
id is auto-increment. But there are also records being saved with ID =
0, which may be the problem?

The thing that really makes no sense is that these rows being created
don't pass Validation. And in my controllers $this->Model->save() is
always called like so:

if ($this->Model->validates()) {
$this->Model->save($data, array('validate' => false));
}

I've been trying to figure this out for some time, and really have no
clue. Sometimes I've also noticed if I visit the edit() action of the
controller, ie domain.com/model/edit?id=123 and I hit Refresh it asks
me to confim form resubmission, even though I never submitted a form,
just went directly the URL. That might have something to do with it.

Any advice would be greatly appreciated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Themes and Languages

2010-03-22 Thread Kareem Sabri
Hello,

I have multiple languages on my site (right now just English and
French). English is the default layouts and views. French is a theme
called 'french'. Sometimes I apply other themes for clients, so I
create themes and just override the views I want. The problem is, for
a french language site, if a themed view file doesn't exist it
defaults back to English. I want the French sites (identified by a
language_id field in the database) to default to the 'french' theme if
the theme file isn't found.

I've considered a couple of ways to do this:

1.

Put in my app_controller - where themes are applied:

if (file_exists('/views/themed/theme_name/'.$this-
>params['action'].'.ctp') {
$this->theme = 'theme_name';
} else {
   if ($language_id==2) {
 $this->theme = 'french'
   }
}

This solution is ok, but I'm not crazy about it as I'm probably
duplicating functionality from cakes core classes.

2.

Ditch themes for languages and create multi-language view files
(English and French are identical except for text being translated -
same stylesheets). Also not crazy about this, I like my clean view
files with very little PHP in them.

Does the community have any better suggestions to handle Language
switching?

Thanks in advance.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: No SQL Dump when debug set to 2

2010-03-09 Thread Kareem Sabri
I have 32 on the script in question. Even on scripts with 1 it doesn't
show.

On Mar 9, 8:09 pm, Jon Bennett  wrote:
> > Nope, still on 1.2
>
> there's a limit of 200 sql queries, if you have more than that none will show.
>
> J
>
>
>
>
>
>
>
> > On Mar 9, 7:23 pm, Graham Weldon  wrote:
> >> On 10/03/2010, at 11:13 AM, Kareem Sabri wrote:
>
> >> > Hello,
>
> >> > In production mode, occasionally I want to debug something in my
> >> > Content Management System.
>
> >> > So I add Configure::write('debug', 2); in my controller code.
>
> >> > I get no SQL info. The table that holds it is appended to the layout,
> >> > but it's empty except for 0 query took 0 ms (despite that many queries
> >> > are taking place). It's not just not displaying, when I view the
> >> > source code the table is empty.
>
> >> > Any suggestions?
>
> >> > Thanks!
>
> >> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> >> > with their CakePHP related questions.
>
> >> > 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 
> >> > athttp://groups.google.com/group/cake-php?hl=en
>
> >> Are you using CakePHP 1.3?
> >> If so, you'll need to include the sql_dump element
>
> >> element('sql_dump'); ?>
>
> >> Cheers,
>
> >> Graham Weldon
> >> e. gra...@grahamweldon.com
> >> p. +61 407 017 293
> >> w.http://grahamweldon.com
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> --
> jon bennett -www.jben.net- blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: No SQL Dump when debug set to 2

2010-03-09 Thread Kareem Sabri
Nope, still on 1.2

On Mar 9, 7:23 pm, Graham Weldon  wrote:
> On 10/03/2010, at 11:13 AM, Kareem Sabri wrote:
>
>
>
>
>
> > Hello,
>
> > In production mode, occasionally I want to debug something in my
> > Content Management System.
>
> > So I add Configure::write('debug', 2); in my controller code.
>
> > I get no SQL info. The table that holds it is appended to the layout,
> > but it's empty except for 0 query took 0 ms (despite that many queries
> > are taking place). It's not just not displaying, when I view the
> > source code the table is empty.
>
> > Any suggestions?
>
> > Thanks!
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Are you using CakePHP 1.3?
> If so, you'll need to include the sql_dump element
>
> element('sql_dump'); ?>
>
> Cheers,
>
> Graham Weldon
> e. gra...@grahamweldon.com
> p. +61 407 017 293
> w.http://grahamweldon.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


No SQL Dump when debug set to 2

2010-03-09 Thread Kareem Sabri
Hello,

In production mode, occasionally I want to debug something in my
Content Management System.

So I add Configure::write('debug', 2); in my controller code.

I get no SQL info. The table that holds it is appended to the layout,
but it's empty except for 0 query took 0 ms (despite that many queries
are taking place). It's not just not displaying, when I view the
source code the table is empty.

Any suggestions?

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Can't configure Memcached properly

2010-02-16 Thread Kareem Sabri
I see, I misunderstood. I've altered my core configuration file and
now have:

Cache::config('_cake_core_', array('engine' => 'File'));
Cache::config('_cake_model_', array('engine' => 'File'));

Cache::config('default',
array(
'engine' => 'Memcache',
'duration' => 30,
'servers' => array('127.0.0.1:11211 '),
'compress' => false
)
);

But the File Engine is still being used for cacheing everything.

On Feb 16, 4:31 pm, Pablo Viojo  wrote:
> The configuration that I send allows you to use memcached (or whatever you
> like) for all caches but the internal cake's cache (that should use file)
>
> I have this configuration in a prod environment (using several memcached
> servers) and it works fine.
>
> Regards,
>
> Pablo Viojo
> pvi...@gmail.comhttp://pviojo.net
>
> ¿Que necesitas?http://www.needish.com
>
>
>
> On Tue, Feb 16, 2010 at 6:20 PM, Kareem Sabri  wrote:
> > Thanks for your reply Pablo.
>
> > I'm able to use CakePHP's File Engine for cacheing, however this has
> > numerous drawbacks when compared to memcached:
>
> > I don't cache view files, because all of my pages require the
> > controller to run and usually a database query as well, so I cache
> > database queries.
>
> > Cacheing database queries in CakePHP's file form doesn't really help
> > my performance significantly, due to the fact that my database server
> > is significantly more powerful than my web server and seek times are
> > very low and my tables/queries have been optimized to allow mySQL to
> > only have to look to one row for most queries. The big benefit comes
> > from memcached storing the results in a chunk of memory that it owns,
> > which CakePHP's default cacheing can't do.
>
> > So, it's very important to me to get memcached working with Cake, and
> > I expect it must be the same case for others.
>
> > On Feb 12, 1:17 pm, Pablo Viojo  wrote:
> > > I was having issues using memcached for cake internal cache and memcached
> > > has a maximum size for each stored object (1 MB) so I prefer to use File
> > for
> > > the internal cache. I defined
>
> > >     Cache::config('_cake_core_', array('engine' => 'File'));
> > >     Cache::config('_cake_model_', array('engine' => 'File'));
>
> > > before
>
> > >     Cache::config('default', ...
>
> > > If you do this, remember to check if app/tmp/cache/models
> > >  app/tmp/cache/persistent and app/tmp/cache/views exists and has
> > read/write
> > > privileges
>
> > > Regards
>
> > > Pablo Viojo
> > > pvi...@gmail.comhttp://pviojo.net
>
> > > ¿Que necesitas?http://www.needish.com
>
> > > On Fri, Feb 12, 2010 at 3:08 PM, Kareem Sabri 
> > wrote:
> > > > Thanks for the tip. However, that didn't solve the issue.
>
> > > > Any other advice?
>
> > > > On Feb 12, 5:55 am, majna  wrote:
> > > > > Example:
>
> > > > >  Cache::config('default', array(
> > > > >               'engine' => 'Memcache', //[required]
> > > > >               'duration'=> 30, //[optional]
> > > > >               'servers' => array('192.168.1.11:11211 '),
> > > > >               'compress' => false,
> > > > >       ));
>
> > > > > use your server IP
>
> > > > > On Feb 11, 11:43 pm, Kareem Sabri  wrote:
>
> > > > > > Hello,
>
> > > > > > Hopefully someone can help me out here.
>
> > > > > > I have installed Memcached and all its dependencies. I have
> > verified
> > > > > > it is running correctly and I can connect via port 11211 (in
> > command
> > > > > > line, not with cake)
>
> > > > > > My core.config is the default:
>
> > > > > >         Cache::config('default',
> > > > > >                 array(
> > > > > >                         'engine' => 'Memcache',
> > > > > >                         'duration' => 30
> > > > > >                 )

Re: Can't configure Memcached properly

2010-02-16 Thread Kareem Sabri
Thanks for your reply Pablo.

I'm able to use CakePHP's File Engine for cacheing, however this has
numerous drawbacks when compared to memcached:

I don't cache view files, because all of my pages require the
controller to run and usually a database query as well, so I cache
database queries.

Cacheing database queries in CakePHP's file form doesn't really help
my performance significantly, due to the fact that my database server
is significantly more powerful than my web server and seek times are
very low and my tables/queries have been optimized to allow mySQL to
only have to look to one row for most queries. The big benefit comes
from memcached storing the results in a chunk of memory that it owns,
which CakePHP's default cacheing can't do.

So, it's very important to me to get memcached working with Cake, and
I expect it must be the same case for others.

On Feb 12, 1:17 pm, Pablo Viojo  wrote:
> I was having issues using memcached for cake internal cache and memcached
> has a maximum size for each stored object (1 MB) so I prefer to use File for
> the internal cache. I defined
>
>     Cache::config('_cake_core_', array('engine' => 'File'));
>     Cache::config('_cake_model_', array('engine' => 'File'));
>
> before
>
>     Cache::config('default', ...
>
> If you do this, remember to check if app/tmp/cache/models
>  app/tmp/cache/persistent and app/tmp/cache/views exists and has read/write
> privileges
>
> Regards
>
> Pablo Viojo
> pvi...@gmail.comhttp://pviojo.net
>
> ¿Que necesitas?http://www.needish.com
>
>
>
> On Fri, Feb 12, 2010 at 3:08 PM, Kareem Sabri  wrote:
> > Thanks for the tip. However, that didn't solve the issue.
>
> > Any other advice?
>
> > On Feb 12, 5:55 am, majna  wrote:
> > > Example:
>
> > >  Cache::config('default', array(
> > >               'engine' => 'Memcache', //[required]
> > >               'duration'=> 30, //[optional]
> > >               'servers' => array('192.168.1.11:11211 '),
> > >               'compress' => false,
> > >       ));
>
> > > use your server IP
>
> > > On Feb 11, 11:43 pm, Kareem Sabri  wrote:
>
> > > > Hello,
>
> > > > Hopefully someone can help me out here.
>
> > > > I have installed Memcached and all its dependencies. I have verified
> > > > it is running correctly and I can connect via port 11211 (in command
> > > > line, not with cake)
>
> > > > My core.config is the default:
>
> > > >         Cache::config('default',
> > > >                 array(
> > > >                         'engine' => 'Memcache',
> > > >                         'duration' => 30
> > > >                 )
> > > >         );
>
> > > > I am running on a Linux box, no issues with Windows I saw on some
> > > > other threads. And I haven't modified the default directory structure
> > > > at all, everything is currently in my public_html directory.
>
> > > > However, I get: Warning (512): Cache not configured properly. Please
> > > > check Cache::config(); in APP/config/core.php [CORE/cake/libs/
> > > > configure.php, line 663] and Cake falls back to using the FileEngine
> > > > for Cacheing.
>
> > > > Any help would be greatly appreciated, thanks.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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 > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Can't configure Memcached properly

2010-02-12 Thread Kareem Sabri
Thanks for the tip. However, that didn't solve the issue.

Any other advice?

On Feb 12, 5:55 am, majna  wrote:
> Example:
>
>  Cache::config('default', array(
>               'engine' => 'Memcache', //[required]
>               'duration'=> 30, //[optional]
>               'servers' => array('192.168.1.11:11211 '),
>               'compress' => false,
>       ));
>
> use your server IP
>
> On Feb 11, 11:43 pm, Kareem Sabri  wrote:
>
>
>
> > Hello,
>
> > Hopefully someone can help me out here.
>
> > I have installed Memcached and all its dependencies. I have verified
> > it is running correctly and I can connect via port 11211 (in command
> > line, not with cake)
>
> > My core.config is the default:
>
> >         Cache::config('default',
> >                 array(
> >                         'engine' => 'Memcache',
> >                         'duration' => 30
> >                 )
> >         );
>
> > I am running on a Linux box, no issues with Windows I saw on some
> > other threads. And I haven't modified the default directory structure
> > at all, everything is currently in my public_html directory.
>
> > However, I get: Warning (512): Cache not configured properly. Please
> > check Cache::config(); in APP/config/core.php [CORE/cake/libs/
> > configure.php, line 663] and Cake falls back to using the FileEngine
> > for Cacheing.
>
> > Any help would be greatly appreciated, thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Can't configure Memcached properly

2010-02-11 Thread Kareem Sabri
Hello,

Hopefully someone can help me out here.

I have installed Memcached and all its dependencies. I have verified
it is running correctly and I can connect via port 11211 (in command
line, not with cake)

My core.config is the default:

Cache::config('default',
array(
'engine' => 'Memcache',
'duration' => 30
)
);

I am running on a Linux box, no issues with Windows I saw on some
other threads. And I haven't modified the default directory structure
at all, everything is currently in my public_html directory.

However, I get: Warning (512): Cache not configured properly. Please
check Cache::config(); in APP/config/core.php [CORE/cake/libs/
configure.php, line 663] and Cake falls back to using the FileEngine
for Cacheing.

Any help would be greatly appreciated, thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 call Model1->find("all") from Model2 Controller

2010-01-16 Thread Kareem Sabri
$this->loadModel('Project');
$this->Project->find('all');

On Jan 16, 2:13 am, codef0rmer  wrote:
> I want to call Project->find("all") from UserController. I tried with
> $this->Product->find("all") as well as Product::find("all"). but no
> luck
>
> Is there any other option?
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Different expiry values for different sessions

2010-01-15 Thread Kareem Sabri
Hello,

I'd like to have different sessions have different lifetimes. For
general users I'd like the sessions to persist for days, but for Admin
users I'd like the sessions to expire when the browser closes. Is this
possible? Thanks in advance.
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Associations to other models

2010-01-13 Thread Kareem Sabri
Excellent, thank you!

On Jan 13, 2:44 am, John Andersen  wrote:
> You have to specify recursive 2 in your find statement. 
> See:http://book.cakephp.org/view/73/Retrieving-Your-Data#find-449
> andhttp://book.cakephp.org/view/439/recursive
> for information on the recursive option.
> Enjoy,
>    John
>
> On Jan 13, 2:35 am, Kareem Sabri  wrote:
>
>
>
> > Hello,
>
> > I have a model called sites. A Site hasAndBelongToMany Entries. An
> > Entry belongsTo one Type and one Saving.
>
> > So, I have an entries_sites table, and an entry has a type_id and a
> > saving_id
>
> > I want to fetch all Entries that belong to a Site, and also get the
> > associated Type and Saving for each Entry. The problem is, if I fetch
> > a Site it will fetch all associated Entries along with it, but won't
> > also fetch the Type and Saving associated with each entry. If I fetch
> > Entries I can't query them based on site_id (as far as I know) because
> > that field isn't in the table, it's in the entries_sites table.
>
> > Is there a way to fetch a Site and get all associated Entries and the
> > associated Type and Saving for each Entry? Thanks in advance!
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Associations to other models

2010-01-12 Thread Kareem Sabri
Hello,

I have a model called sites. A Site hasAndBelongToMany Entries. An
Entry belongsTo one Type and one Saving.

So, I have an entries_sites table, and an entry has a type_id and a
saving_id

I want to fetch all Entries that belong to a Site, and also get the
associated Type and Saving for each Entry. The problem is, if I fetch
a Site it will fetch all associated Entries along with it, but won't
also fetch the Type and Saving associated with each entry. If I fetch
Entries I can't query them based on site_id (as far as I know) because
that field isn't in the table, it's in the entries_sites table.

Is there a way to fetch a Site and get all associated Entries and the
associated Type and Saving for each Entry? Thanks in advance!
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


CakePHP and subdirectories

2009-12-18 Thread Kareem Sabri
Hello,

I'm trying to rebuild my application using CakePHP, but I have a
relatively unique issue (I think). I need to be able to create
numerous subdirectories and have them all inherit the same
functionality as the webroot.

So, for example, I have a class Users. Then I can go to 
http://mydomain.com/users/edit
and use the edit action of my controller. But I also want to be able
to go to http://mydomain.com/subdirectory/users/edit and also use the
edit action. Each subdirectory should inherit the functionality of all
of the controllers in my application, the only difference is each
subdirectory will be associated with a unique Id in certain tables of
my database and will fetch the data it is associated with. Can anyone
suggest a way to accomplish this using CakePHP? URL rewriting perhaps?
I also want to be able to change the views associated with each
subdirectory (or at least set a new default layout), and I need to be
able to create these with relative ease and speed.

I can't do this using GET parameters (ie. mydomain.com/subdirectory/
users/edit?directory_id=6) because clients need to be able to specify
pretty URLs to give out.

Apologies if this is a naive question, I'm not too familiar with using
mod_rewrite. Thanks in advance for any advice!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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