我创建了一个名为“atom”的Reportico项目和一个名为“Receipts”的报告,然后在ReportController中创建了action = receipt。 This是我跟着教程:Reportico:yii2如何嵌入链接?
控制器代码:
public function actionReceipts()
{
return $this->render('receipts');
}
我创建receipts.php
<?php
use yii\helpers\Html;
use yii\helpers\Url;
$this->title = Yii::t('app', 'Reports');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="report-index">
<div class="container">
<div class="row">
<div class="col-sm-1">
</div>
<div class="col-sm-11">
<?php
$reportico = \Yii::$app->getModule('reportico');
$engine = $reportico->getReporticoEngine(); // Fetches reportico engine
$engine->access_mode = "ONEREPORT"; // Allows access to single specified report
$engine->initial_execute_mode = "PREPARE"; // Starts user in report criteria selection mode
$engine->initial_project = "atom"; // Name of report project folder
$engine->initial_report = "receipts"; // Name of report to run
$engine->bootstrap_styles = "3"; // Set to "3" for bootstrap v3, "2" for V2 or false for no bootstrap
$engine->force_reportico_mini_maintains = true; // Often required
$engine->bootstrap_preloaded = true; // true if you dont need Reportico to load its own bootstrap
$engine->clear_reportico_session = true; // Normally required
$engine->execute();
?>
</div>
</div>
</div>
</div>
我的代码应该打开
http://localhost/Atom/backend/web/index.php?r=report%2Freceipts
当我尝试它,我得到了像我附上的图片
当我输入在config.php define('SW_ADMIN_PASSWORD','1234');
没有显示的密码。
我不需要强制用户输入密码!
我从config.php中删除它,但仍然有空白页!并仍然要求输入密码。 –
顺便说一句,当我打开'http://localhost/Atom/backend/web/index.php?r = reportico'时,密码消失了。它没有密码打开仪表板。 –
我得到了解决方案:它是在配置项目..我忘了添加主机名。或IP。 –