CakePHP: Use post title as the slug for view method

后端 未结 4 710
情深已故
情深已故 2020-12-22 06:44

I have been trying to do the following method to create urls like:

domain.com/portfolio/This_is_a_test_post

function view ( $title )
{           


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-22 07:23

    you can use this lib support to convert urls without more efforts

    http://someguyjeremy.com/blog/slugs-ugly-bugs-pretty-urls

提交回复
热议问题