Formatting database results

#11
[eluser]fireproofsocks[/eluser]
I was wondering how to do filters in the view while using the parser library too... I agree that the view is the place for these filters (e.g. htmlentities), and there are plenty of times when you can't simply store the data one way to avoid the problem. E.g. one view may need to see the data differently than another.

A lot of template engines allow for view-level filtering: you can define a function to operate on the value being substituted into the placeholder. I'm new to CI, but it doesn't seem that the parser library is geared for this (it's more lightweight)... so the only other way I can think to do this is to just resort to straight PHP as a previous poster suggested... but I hate having raw PHP in the view. It may be fast, but it rubs me the wrong way if a designer can delete one semi-colon and break the whole app.


Messages In This Thread
Formatting database results - by El Forum - 09-17-2009, 11:32 PM
Formatting database results - by El Forum - 09-18-2009, 01:52 AM
Formatting database results - by El Forum - 09-18-2009, 10:28 AM
Formatting database results - by El Forum - 09-18-2009, 07:43 PM
Formatting database results - by El Forum - 09-19-2009, 12:12 AM
Formatting database results - by El Forum - 09-19-2009, 04:54 AM
Formatting database results - by El Forum - 09-19-2009, 12:30 PM
Formatting database results - by El Forum - 09-19-2009, 02:02 PM
Formatting database results - by El Forum - 09-19-2009, 02:14 PM
Formatting database results - by El Forum - 09-19-2009, 10:16 PM
Formatting database results - by El Forum - 09-29-2009, 02:53 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.