0

Joomla 2.5 と JA K2 フィルターおよび検索コンポーネントを使用しています。モジュールを変更しようとしています。カテゴリを選択すると、 という別のファイルが表示されますcustom.html

<script type="text/javascript">
jQuery(document).ready(function() {
    //disable the dynamic select list
    jQuery('#extraList').attr('disabled', 'disabled');
    //hide the dynamic select list
    jQuery('#extraList').hide();

    WireEvents();
});

function WireEvents() {
    jQuery('#category_id').change(function() {
        var value = jQuery('#category_id').val();
        if (value > 0) {
            //show the dynamic list
            jQuery('#extraList').removeAttr('disabled');
            jQuery('#extraList').show();

            jQuery.get("<?php dirname(__FILE__) . '/' . 'custom.html'; ?>",
                    function(data) {                             
                        jQuery('#outPutDiv').html(data);
                    }
            );

        } else {
            //disable the dynamic list
            jQuery('#extraList').attr('disabled', 'disabled');
            //hide the dynamic list
            jQuery('#extraList').hide();
        }

    });
}
</script>

問題は、返す代わりにcustom.htmlホームページを返すことですか? どうすれば修正できますか?これはいくつかのスクリーンショットです:ここに画像の説明を入力

ここに画像の説明を入力

4

1 に答える 1

0

PHP ドキュメントによるとdirname()、親ディレクトリのパスのみが返されます。しかし、モジュールは iirc にありますが、joomla_root/modules/module_nameそれがリクエストにありません。不足しているパスを手動で前に追加するか、そのために Joomla の定数を使用できます ( JPATH_SITE . '/modules/module_name/dirname(__FILE__)'iirc で動作するはずです)。

于 2013-09-30T20:51:17.827 に答える