質問

私のプレテスサップに問題があります、私はCMSを使用せずにモジュールにWebページを作成します。

しかし、このURLを使用してコントローラにアクセスしたい場合: http://example.com/ Comparateur / Module / ProduitsMarchand / ProductList

私はそのメッセージを持っています&リンクをクリックすると、404エラー

があります。
[Debug] This page has moved
Please use the following URL instead: http://example.com/comparateur/index.php?controller=ProductList&module=ProduitsMarchand
.

私のコントローラーはこの

のように見えます
class ProduitsMarchandProductListModuleFrontController extends ModuleFrontController {

    public $php_self ="ProductList";
    /**
     *  Initialize controller
     *  @see FrontController::init()
     */
    public function init() {
        parent::init();
    }

    /**
     *  Assign template vars related to page content
     *  @see FrontController::initContent()
     */
    public function initContent() {
        parent::initContent();

        $this->setTemplate("ProductList.tpl");
    }
}
.

環境設定> SEO&URL

Page: produitsmarchands - productlist
URL: product-list
.

役に立ちましたか?

解決

あなたはいくつかの基本的な間違いを得ました。

まずFRONTCONTROLLERを使用する必要がありますが、むしろModuleFrontControllerを使用する必要があります。あなたはモジュールを完全に存在する新しいコントローラではないので。

次のことはあなたのクラスが間違っていることです。それはこれに似たものであるべきです。

yourModuleNameYourControllernameModulefrontController

yourModulename=あなたのモジュールの名前

yourcontrollername=コントローラの名前、Module / Controllers / Front

にある必要があります。

と最後にこれは完全に間違っています

$this->setTemplate(__FILE__.'/../../../views/templates/front/ProductList.tpl');
.

この

を使うべきです
$this->setTemplate('ProductList.tpl');
.

その方法あなたのファイルはあなたのモジュール/ビュー/テンプレート/前面

にあります

そしてあなたがすべてのガイドラインに従ったならば、あなたはあなたのModuelControllerのためのフレンドリーなURLを設定で設定できるべきです - > seo&url

brの

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top