Welcome Guest, Not a member yet? Register   Sign In
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.




Theme © iAndrew 2016 - Forum software by © MyBB