⚠ In case you've missed it, we have migrated 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 is an archived forum. ⚠

  •     

profile picture

Use PHP function ucwords in GC



TheSpawn
  • profile picture
  • Member

Posted 27 October 2014 - 04:31 AM

Hi, I have a question about if I can use the PHP function ucwords in GC, because I have saved the data in the DB in uppercase and I want to show this in first capital letter.
 
 
Thank you!

 


Amit Shah
  • profile picture
  • Member

Posted 27 October 2014 - 08:35 AM

yes you can.. but u need to use callback_column for the same. There you can apply any formatting to the output you desire for.


TheSpawn
  • profile picture
  • Member

Posted 27 October 2014 - 13:58 PM

Nice!... this works for me. Now, how I can do the same but in a set_relation?

 

 

Thank you!!!


Amit Shah
  • profile picture
  • Member

Posted 29 October 2014 - 06:32 AM

well.. sorry about that - u might not be able to do the same in set relation directly.. What you can do is - build an array of the elements, do the casing and the instead of using set_relation.. u can use the following...

http://www.grocerycrud.com/documentation/options_functions/field_type#dropdown-field

 

Hope this helps ..

 

Happy Gcing :)