I want to query a HABTM relationship, with two relationships.
Say I have tables
players
positions
players_positions
And I want to find players who are both shortstops (Position.id=1) and
pitchers (Position.id=3).
Is there a cake way to do this?
--
Thanks,
Ryan
Ginstrom
--~--~-~--~~~---~--~~
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
,
Ryan Ginstrom
--~--~-~--~~~---~--~~
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
() ;
}
In products_controller:
function color( $id )
{
$this-set( 'data', $this-requestAction( /colors/getById/$id ) ) ;
}
// view same...
And you're good to go g
--
Regards,
Ryan Ginstrom
--~--~-~--~~~---~--~~
You received this message because you
will get
you an empty set, and now you don't know what color you were looking for.
If you go from the color model, you will get a color entry, and an empty set
of products, so you will be able to tell the user, Sorry, no mauve
products.
--
Regards,
Ryan Ginstrom
to create a Color model, if you don't have one.
You could start with this:
?php
class ColorsController extends AppController
{
var $name = 'Colors';
var $scaffold = true ;
function getById( $id ) { return $this-Color-findById( $id ) ; }
}
?
--
Regards,
Ryan Ginstrom
be called on requestAction
The simple way around this would be to check if the action on
members_controller is getMember, and if so exiting beforeFilter
--
Regards,
Ryan Ginstrom
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Logan wrote:
Because i need to used in the view and/or the controller. Probably i'm
missing something.
I'm kind of new to MVC.
If I'm not mistaken, you can access components from the view (just not
helpers from the controller).
If you are serving an image generated on the fly, you could also
-setFormTag($field) ;
$msg = $this-Html-tagIsInvalid($this-Html-model,
$this-Html-field) ;
if ( !$msg )
{
return null ;
}
return sprintf('div class=error_message%s/div', $msg ) ;
}
}
/* +++ */
//
How does that look?
--
Regards,
Ryan Ginstrom
from the database.
--
Regards,
Ryan Ginstrom
--~--~-~--~~~---~--~~
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
htmlspecialchars() ) on
the value, which escapes HTML entities. Since I am using my database to store
HTML text, that's not what I wanted.
But the latest version of my posted code supports both $this-params['data']
and $this-data.
Regards,
Ryan
---
Ryan Ginstrom
[EMAIL PROTECTED] / [EMAIL PROTECTED]
http
(
'validations' = $validations,
'data' = $this-controller-data ) ) ;
}
--
Regards,
Ryan Ginstrom
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake
, or if not, the fallback validation error message from
HtmlHelper.
Does this sound like a good direction to take my validation? Thanks for
any feedback.
--
Regards,
Ryan Ginstrom
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
' )))
{
$this-checkSession() ;
}
return true ;
}
Regards,
--
Ryan Ginstrom
--~--~-~--~~~---~--~~
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
'='view', language=en));
But here the languages are hard coded.
Thanks in advance for any help.
--
Ryan Ginstrom
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake
15 matches
Mail list logo