0

I am trying to hide a list item in Yii CList view based on a visibility condition.

Based on an id that I get from the list , I need to check whether a condition exists and display that item only if that condition is true.

I have a request_tbl and ibnvite_tbl. Request table contains all requests in the system. It contains a field named invite_type. If invite_type is 3 , there will be an insertion in invite table with comma separated values of invited users with corresponding request_id.

My requirement is:

On a user login, based on my list view, if invite_type is 3 need to display the list items from request table for the logged in user_id. if the invite_type not equal to 3 we can list the items without checking,

For me only white space is showing in case there is no user_id in invite table when the invite_type is 3. How can I display the items?.

If more details are required , I will add it.

anu
  • 458
  • 2
  • 13
  • 36
  • Could you improve formatting (emphasise problem, add a bit space), and perhaps add some code? –  Oct 30 '13 at 12:57
  • If I understood your issue correctly, here' how I will solve it (although there may be better ways to do it). I will check for the invite_type value with a queryScalar in the controller action and based on the value will render the appropriate List in the view. It results in one extra query though. – redGREENblue Oct 30 '13 at 14:28

0 Answers0