thesli / laravel-jade-engine-package

12 stars 2 forks source link

Properly Remove '.jade' Extension #6

Open kylefarris opened 9 years ago

kylefarris commented 9 years ago

Your implementation of rtrim was invalid. The way you had it setup, the script would remove any "period, j, a, d, or e" from the end of the file name--that's how PHP's rtrim works. So, if someone passed in something like "homepage" like I did, the "e" kept getting removed from the filename. The solution is simple and even more powerful because it will replace .jade and even .JADE from the end of the file name.