*face palm* doh!!!
Well that's embarrassing
... long day :(
Thanks!!
On Sep 20, 9:08 pm, Joel Perras <[EMAIL PROTECTED]> wrote:
> FTCB (From the CookBook): "[...] join table’s name needs to include
> the names of both models involved, in alphabetical order".
>
> So it should be emphas
FTCB (From the CookBook): "[...] join table’s name needs to include
the names of both models involved, in alphabetical order".
So it should be emphases_photographers.
http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM
-J.
On Sep 20, 9:10 pm, Brenton B <[EMAIL PROTECTED]> wrote:
> Hmmm .
Hmmm ... I sort of have this working ... however, now that I have a
join table for HABTM it's fubarred again.
The table is photographers_emphases, so class is
PhotographersEmphasis ... does the inflector take into account join
tables like that properly?
On Sep 17, 11:06 pm, Brenton B <[EMAIL PROT
I brought this up to another gentleman in a different thread but
perhaps it will suit you better. Check out EAV schema modeling.
I wrote about it a bit ago here http://blog.joebeeson.com/?p=30 but it
may do you better to look at a schema, which you can
download and run against a test database.
ht
I did similar MySQL geocoding situation where I had to use HAVING and
ended up with something like this, you'll probably have to tweak it
for your own system.
http://blog.joebeeson.com/wp-content/uploads/2008/08/query.jpg
Sorry it's an image, didn't feel like typing it all back up. The
original
You can not search on conditions of a related model (generally, some
tricking with bind() might do the trick).
But, you can search for a group ($this->MyGroup->find()), which will
automatically get you all the related Users as well. You can further
filter these users with the Containable beh
Hi,
I have 2 classes MyUser and MyGroup.
Both of them are tied by HABTM relationship.
I want to make a find all query that will find all Users belonging to
a certain group I don't know how to make this query. All I got are
examples with queries on the same table.
class MyUser extends AppModel {
What you need to do is set $useDBConfig for each model.
var $useDBConfig = 'A';
then in your DATABASE_CONFIG you would use
var $A = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'usern
Actually, none of the properties seem to work, atleast not for me.
Name and key (apart from time) do not work. Setting them directly in
beforeFilter works though.
On Sep 20, 9:41 pm, Kenchu <[EMAIL PROTECTED]> wrote:
> I dont see the point of having a page where they show how to set
> properties
I dont see the point of having a page where they show how to set
properties in the controller if they dont work. As you said, I did not
use the long version of the write command, since it said on the page
before how to set it up using properties.
On Sep 20, 6:30 pm, villas <[EMAIL PROTECTED]> wro
This is an example of a classic sub-type entity.
As was previously stated add all your common attributes to the parent
table. Performing an inner join on your foreign key between the
parent and sub-type entities will limit the result set to just the
specific sub-type you are interested in (i.e.
Same problem with $this->params and my post never show up, either.
On Aug 1, 1:32 am, cephyn <[EMAIL PROTECTED]> wrote:
> Given that I have
> ***
> echo $form->select(
> 'ContactID',
> $pass,
> null,
> array('size'=>'5'),
> fal
I've got an existing MySql instance that contains 4 databases (lets
call them A, B, C & D). Each has tables as you would expect. For
this post lets say tables are named like table1, table2 etc.. in each
database. My single user/password has access to all databases in the
instance.
My problem i
I know it sounds a bit obvious, but did you look at afterSave() ?
On Sep 19, 6:36 pm, "Novice Programmer" <[EMAIL PROTECTED]>
wrote:
> Hello guys,
>
> In some of my cases, i format the data in beforeSave Callback of the Model.
> In the controller, after the call to function Model::save, how do i
Before you criticise, are you sure that you read and tried what it
said in the docs?
Example given in the docs is:
$this->Cookie->write('last_name', 'Masters', false, '1 hour');
Therefore you should be able to do this:
$this->Cookie->write('cart', array(124,1232,3232), false, '1 hour');
>From
Hi all,
I have a problem that i can't resolve with the examples found on the
web :
I want to see ProgramState.name in place of
ProgramFile.program_state_id when paginating Program hasMany
ProgramFile.
I'm using pagination too.
I hope it's clear.
Thanks.
Yudao.
--~--~-~--~~--
I believe quite recently the syntax was changed and comparison
operators etc should now be placed in the left-hand side of the
array. I think this was done for security to reduce chances of SQL
injection. In that respect, I think you may have found a place where
the book may be a little out of
hi, take a look at these behaviors:
http://trac.assembla.com/mi/browser/branches/base/models/behaviors
you might be interested in the GD one
On Sep 20, 1:40 am, rocket <[EMAIL PROTECTED]> wrote:
> i was looking around and didn't stumble upon much. i was just
> wondering if anyone knew of a good
Thanx manja.
That article was perfect got it to run.
On Sep 20, 10:59 pm, majna <[EMAIL PROTECTED]> wrote:
> function getNews()
> {
> $news = ClassRegistry::init('News');
> $data = $news->find('all', array('limit'=>3,
> 'order'=>'News.date DESC'));
>
function getNews()
{
$news = ClassRegistry::init('News');
$data = $news->find('all', array('limit'=>3,
'order'=>'News.date DESC'));
return $data;
}
function beforeRender()
{
$this->set('latest_news', $this->getNews());
}
But ap
Hi all,
I'm pretty new to CakePHP and trying to learn it. At the moment I have
a news section in the default layout which uses the News model and
outputs the latest 3 news from the database.
At first I thought of using it in the app_controller.php by creating a
function in the app_controller:
f
Thanks Willis - I finally came up with the same thing - I appreciate
the confirmation. I had to add the second rule to pick up requests to
the 'home or default' page for the site without the trailing slash as
well.
RewriteRule ^myappdirams/(.*)$ /$1 [R=301,L]
RewriteRule ^myappdir / [R=301,
Thanks! Works perfect now. Though I think it's bad they dont say this
in the documentation.
On Sep 20, 11:42 am, "Yodi Aditya" <[EMAIL PROTECTED]> wrote:
> Try using :
> function beforeFilter() {
> $this->Cookie->time = '5 Days';
> $this->Cookie->path = '/';
>
> }
>
> On 9/20/08, Kenchu <
I don't see why $_REQUEST shouldn't work as normal... but cake
automatically puts these vars into:
$this->params['form']; // from $_POST
or
$this->params['url']; // from $_GET
Hope that helps.
Adam
On Sep 19, 11:18 pm, json <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am new to here
>
> I want to h
> There's gotta be an easy way to specify this in the .htaccess - it's
> just killing me!
This should do it...
RewriteEngine On
RewriteRule ^/?myappdir/(.*)$ /$1 [R=301,L]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
Thanks a lot!
On 20 Wrz, 11:37, Günther Theilen <[EMAIL PROTECTED]> wrote:
> $form->input('category_id', array(
> 'options' => $categoriesList,
> 'escape' => false
> ));
>
> Regards
> Guenther
--~--~-~--~~~---~--~~
You received this message because you are su
Try using :
function beforeFilter() {
$this->Cookie->time = '5 Days';
$this->Cookie->path = '/';
}
On 9/20/08, Kenchu <[EMAIL PROTECTED]> wrote:
>
>
> I've managed to get cookies working for the session, but if I restart
> my browser, the cookies seem to be gone, and $cookieTime doesn't se
Hi,
kicaj wrote:
> ...in view:
> $form->input('category_id', array('options'=>$categoriesList));
try this:
$form->input('category_id', array(
'options' => $categoriesList,
'escape' => false
));
Regards
Guenther
--~--~-~--~~~---~--~~
You received this mes
28 matches
Mail list logo