Last active
December 18, 2015 14:09
-
-
Save buchin/5794831 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% api %} | |
{% for index, item in api %} | |
{{ item.link | url_to_hyphen | build_permalink_for 2 }} | |
{% endfor%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function url_to_hyphen ($string) { | |
$string = str_ireplace(array('http://'), '', $string); | |
$string = str_ireplace(array('.', '/', '%20'), ' ', $string); | |
return CoreFilters::hyphenize($string); | |
} | |
h2o::addFilter('url_to_hyphen'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
StupidPie
[ASK] lagi nyoba bikin situs agc pdf, utk nangkep link pdfnya pake href="{{ item.link }}" trus skrg mo dibuatin link agc, gmn caranya ya?
contoh link:
http://www.domainku.com/vi_tutorial/warna_warni-pelangi.pdf
maunya jadi agc link: domainku_com-vi_tutorial-warna_warni-pelangi.pdf
atau mungkin dibuatin link agc yg lbh bagus diliat, gmn caranya ya?
saya dah nyoba:
href="{{ item.link | hyphenize }}"
malah nyambung semua, ga ada pembatas - atau _