我在Drupal上傳路徑時遇到了問題,當在一個多語言網站。 我已經制作了一種新語言,並且由於該圖片的源代碼沒有反斜槓,因此無法使用。Drupal上傳多語言網站的路徑
我的函數使用下面的代碼。
variable_get('file_public_path', drupal_get_path('theme', $theme) . '/uploads').'/';
如果我使用下面的一個,它就會起作用。
'/' . variable_get('file_public_path', drupal_get_path('theme', $theme) . '/uploads').'/';
這是一種醜陋的解決方案,我敢打賭,有一些更優雅的方式來處理這個問題。