Question

I want to convert string to string which are url friendly

In my none Zend Framework 2 project is just use urlencode($valueContainingString);

Now i'm building an application with Zend Framework 2, now I was wondering if there is any better way to do this.

I did some research and I looked at constrains for the route but it's not working for me.

Was it helpful?

Solution

Have a look at the \Zend\Escaper classes - there you have plenty of escaping functions for most common use cases.

http://framework.zend.com/manual/2.2/en/modules/zend.escaper.introduction.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top