Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Filter input
  • how can i apply custom filters on inputs in validation?
    in CI, for example, we use 'prep_url' to add 'http://' in the beginning of input string
    i want to do somethings like this, for example, converting this string:
    'i am a string'
    to
    'i-am-a-string'
    thanks
  • You can extend validation class : http://fuelphp.com/docs/classes/validation/validation.html#methods
    i want to do somethings like this, for example, converting this string:
    'i am a string'
    to
    'i-am-a-string'

    If you want to use this for page titles ( in url ) I can suggest you to use Inflector::firendly_title() method
  • my problem is not converting first string to second
    the problem is: how can i do this automatically?
  • So... Do you want to apply automatically a validation to input fields?? Have you tried to extend Form class?
  • Davide Bellini wrote on Sunday 28th of August 2011:
    So... Do you want to apply automatically a validation to input fields?? Have you tried to extend Form class?
    no
    i want to apply some changes on input strings automatically
    i dont think extending Form class be useful
    i need to apply this changes on custom fields so i think i should do this using validation
    i need a way exactly like 'prep_uri' in CI validation

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion