【发布时间】:2021-08-18 15:10:15
【问题描述】:
我正在尝试在 Prestashop 模块中创建一个新页面,因此我创建了一个控制器和一个视图。不幸的是,我收到了这个错误,但没有找到解决方案。 这是我的错误:
这是我的控制器:
<?php
require_once _PS_MODULE_DIR_.'opartdevis/models/OpartQuotation.php';
class OpartDevisAskTypeClientModuleFrontController extends ModuleFrontController
{
public $auth = true;
public $guestAllowed = true;
public function init()
{
$this->display_column_left = false;
$this->display_column_right = false;
parent::init();
}
public function setMedia($isNewTheme = false)
{
parent::setMedia();
$this->registerStylesheet(
'opartdevis-style',
'modules/'.$this->module->name.'/views/css/opartdevis.css'
);
$this->registerJavascript(
'opartdevis-front',
'modules/'.$this->module->name.'/views/js/front.js'
);
$this->registerJavascript(
'opartdevis-tools',
'js/tools.js'
);
}
public function initContent() {
$this->setTemplate('module:opartdevis/views/templates/front/ps17/asktype.tpl');
}
public function postProcess()
{
$type = Tools::getValue('typeClient');
/** return Tools::redirect(
* $this->context->link->getModuleLink(
* 'opartdevis',
* 'createquotation',
* array(
* 'create'=>true,
* 'typeClient'=> $type
*)
*)
*);*/
}
}
这是我的看法:
{extends file='page.tpl'}
{block name="page_content"}
{capture name=path}Ask your client type{/capture}
<h1>Quel type d'utilisateur etes vous ?</h1>
<form action="{$link->getModuleLink('opartdevis', 'askTypeClient')|escape:'htmlall':'UTF-8'}" method="post" class="form-horizontal" enctype="multipart/form-data" id="opartDevisForm">
<p>Quel type d'utilisateur êtes vous ?</p>
<div>
<input type="radio" id="clientType" name="askType" value="clientType"
checked>
<label for="clientType">Client</label>
</div>
<div>
<input type="radio" id="providerType" name="askType" value="providerType">
<label for="providerType">Provider</label>
</div>
<p class="cart_navigation">
<a href="{$link->getPageLink('my-account', true)|escape:'htmlall':'UTF-8'}" class="btn btn-default button button-small">
<span><i class="icon-chevron-left"></i> {l s='Back to Your Account' mod='opartdevis'}</span>
</a>
<button type="submit" name="submitQuotation" id="submitQuotation" class="button btn btn-primary button-medium"><span>Submit</span></button>
</p>
</form>
{/block}
你能帮帮我吗?
我的代码结构基于另一个控制器,它可以在没有任何语言索引的情况下工作。
提前致谢
【问题讨论】:
标签: php prestashop smarty