⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠


jonathanw

Member Since 26 Mar 2014
Offline Last Active Apr 20 2015 01:01 AM
-----

Posts I've Made

In Topic: Multiple relations?

16 April 2015 - 03:47 PM

Solved it by using callbacks!

One that gets the current flow name (for viewing) and one that just list all available flows and their ID (this is used for add/edit operation).

 

If you want to see the code, reply here :)


In Topic: Multiple relations?

16 April 2015 - 11:32 AM

Hmm...

 

I'm getting somewhere atleast.

If I do like this:

 

$crud->set_relation('flow_id','flows','{sender} -> {receiver} ({direction})');

 

I atleast get some result, but only with ID:s.

The view looks like "195 -> 234 (IN)".

Now I need to translate 195 and 234 with the names from the parties table.

 

How do I do this?

 

As far as I can understand by set_relation_n_n, it can only get one field at a time. I've tried

$crud->set_relation_n_n('flow_id','flows','parties','id','sender','name');

but without succes. This of course translates the sender correctly, but not the receiver.

And the whole point being to have {sender} -> {receiver} ({direction}) is therefore lost.

 

Anyone who can help me?