Formatting database results

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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