[Catalyst] Param in the search method
Marcus Ramberg
marcus at thefeed.no
Thu Oct 6 23:27:41 CEST 2005
On 10/6/05, Will Smith <willbelair at yahoo.com> wrote:
>
> 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 <http://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 <http://add.tt> in /Artist I add an artist, then how can I
> pass the artistid to the add.tt <http://add.tt> in /Cd.
> These are just simple relationship question, but I just can't figure out.
> Please help
>
>
Hey Will.
I think you are depending too much on the scaffolding at this point. It's
just meant to be a simple code generation tool to kick off your application.
If you want to do complex things like this, you'll have to start modifying
the templates. For example, you can make the cd add template fill in artist
automatically if it's called with a artistid as a request param, and then
add a add link which includes that param from the artist view action.
--
With regards
Marcus Ramberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20051006/7ae11f34/attachment.htm
More information about the Catalyst
mailing list