[Catalyst] Param in the search method

Will Smith willbelair at yahoo.com
Thu Oct 6 19:56:46 CEST 2005


Thanks, that's what i meant.
Another question that I hope i can get the answer from the expert:
- I have a DB of quite a few tables. Running scaffold is no problem with every single table. Using has_a, has_many (not really work) to display data is ok. But if I want to:
- Add an Artist (this is done by the add.tt created by Scaffold) and then add Cds that belong to that artist. My question is:
1- Using CDBI can I call another sub in different Controller (e.g. call [sub add_cd]  in music::C::CDBI:: cd from music::C::CDBI::artist in any sub using $c->foward(...) , not sure what to put in ). I'm sure that I read this somewhere, but cannot remember
 
2- From add.tt in /Artist I add an artist, then how can I pass the artistid to the add.tt in /Cd.
 
These are just simple relationship question, but I just can't figure out. Please help
 
Thanks 

Marcus Ramberg <marcus at thefeed.no> wrote:


On 10/5/05, Will Smith <willbelair at yahoo.com> wrote:hi,
Can i pass a param from an html page into te search method:
----------
$c->stash->{artist} = music::M::CDBI::Artist->search_like(name=>'%$my_parameter%'); ### my_parameter is the name field from an html page that call the sub
---------
Thanks


$c->stash->{artist} = music::M::CDBI::Artist->search_like(name=>$c->req->param('my_parameter').'%');

Like this?

-- 
With regards
Marcus Ramberg _______________________________________________
Catalyst mailing list
Catalyst at lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst

		
---------------------------------
Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20051006/d440ea74/attachment.htm


More information about the Catalyst mailing list