라우터 기능 좋네요
새해 복 많이 받고 계십니까ㅎㅎ
저는... 모듈별로 짧은 주소 형식을 지정할 수 있다고 하길래 시도해봤는데, 좋습니다~
주소가 루트/schedule/category/26427 이렇게 나오는 건 기본이고요.
루트/schedule/category/26427/selected_month/202103 이런 것은 물론이고
루트/schedule/category/26427/selected_month/202103/26442 이렇게도 됩니다.
심지어는
새 콘텐츠 작성 : 루트/schedule/category/26427/selected_month/202103/selected_day/12/write
기존 콘텐츠 수정 : 루트/schedule/category/26427/selected_month/202103/26442/edit
기존 콘텐츠 삭제 : 루트/schedule/category/26427/selected_month/202103/26442/delete
이게 다 https://github.com/rhymix/rhymix/pull/1322 에 나와 있는 가이드를 보고 module.xml을 짠 덕분입니다ㅋ
요렇게요.
<action name="dispScheduleContent" type="view" permission="list" standalone="false" index="true">
<route route="$schedule_srl:int" />
<route route="selected_month/$selected_month:int" />
<route route="selected_month/$selected_month:int/$schedule_srl:int" />
<route route="category/$category:int" />
<route route="category/$category:int/$schedule_srl:int" />
<route route="category/$category:int/selected_month/$selected_month:int" />
<route route="category/$category:int/selected_month/$selected_month:int/$schedule_srl:int" />
</action>
<action name="dispScheduleInsert" type="view" permission="write" standalone="false" meta-noindex="true">
<route route="write" />
<route route="selected_month/$selected_month/selected_day/$selected_day/write" />
<route route="category/$category/selected_month/$selected_month/selected_day/$selected_day/write" />
<route route="$schedule_srl/edit" />
<route route="selected_month/$selected_month/$schedule_srl/edit" />
<route route="category/$category/$schedule_srl/edit" />
<route route="category/$category/selected_month/$selected_month/$schedule_srl/edit" />
</action>
<action name="dispScheduleDelete" type="view" permission="write" standalone="false" meta-noindex="true">
<route route="$schedule_srl/delete" />
<route route="selected_month/$selected_month/$schedule_srl/delete" />
<route route="category/$category/$schedule_srl/delete" />
<route route="category/$category/selected_month/$selected_month/$schedule_srl/delete" />
</action>
<route route="$schedule_srl:int" />
<route route="selected_month/$selected_month:int" />
<route route="selected_month/$selected_month:int/$schedule_srl:int" />
<route route="category/$category:int" />
<route route="category/$category:int/$schedule_srl:int" />
<route route="category/$category:int/selected_month/$selected_month:int" />
<route route="category/$category:int/selected_month/$selected_month:int/$schedule_srl:int" />
</action>
<action name="dispScheduleInsert" type="view" permission="write" standalone="false" meta-noindex="true">
<route route="write" />
<route route="selected_month/$selected_month/selected_day/$selected_day/write" />
<route route="category/$category/selected_month/$selected_month/selected_day/$selected_day/write" />
<route route="$schedule_srl/edit" />
<route route="selected_month/$selected_month/$schedule_srl/edit" />
<route route="category/$category/$schedule_srl/edit" />
<route route="category/$category/selected_month/$selected_month/$schedule_srl/edit" />
</action>
<action name="dispScheduleDelete" type="view" permission="write" standalone="false" meta-noindex="true">
<route route="$schedule_srl/delete" />
<route route="selected_month/$selected_month/$schedule_srl/delete" />
<route route="category/$category/$schedule_srl/delete" />
<route route="category/$category/selected_month/$selected_month/$schedule_srl/delete" />
</action>
간만에 신기한 경험 겪어보고 글 남겨봤습니다~

윤삼
Lv. 19
아무래도 중급 초반 수준의 코딩 오타쿠인 것 같습니다.
댓글 4
라우터 기능을 쓰면 불필요하게 길어지는 주소도 줄일 수 있죠.
<route route="category/$category/selected_month/$selected_month/$schedule_srl/edit" />
이거도
<route route="$category/$selected_month/$schedule_srl/edit" />
이런식으로 좀 더 줄일 수 있을거예요.
지금 잘려고 누워서 바로 적용은 못해보는데 혹시 그렇게 하면 숫자만 주르륵 나오는 거 아닙니까ㄷㄷㄷㄷ
하긴 그렇게 되도 나름 볼 만하긴 하겠군요ㅋㅋ
저도 나름 비슷한 방법으로 라우터 기능을 쓰는 모듈이 있어요 :)
인스타 주소를 가로채온 것 같기도 하고 눈이 휘둥그레지네요 ^^/