是否可以通过realurl为扩展程序的生成页面添加前缀?我正在使用以下配置:
describe('LoginComponent', () => {
let component: LoginComponent;
let fixture: ComponentFixture<LoginComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
ReactiveFormsModule
],
declarations: [
LoginComponent
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it(`show have as formGroup 'loginForm'`, () => {
const compiled = fixture.debugElement.nativeElement;
console.log(compiled.querySelector('form'));
})
});
现在,我有一个这样的网址: https://www.mydomain/galerie/2016-foobar/1.html 但是我想要这个https://www.mydomain/galerie/2016-foobar/page1.html
答案 0 :(得分:2)
我知道,唯一的解决方案是使用添加这种行为的userFunc。
<p>All Invoices</p>
<br>
<div class="spinner-container" *ngIf="dataSource.loading$ | async">
<mat-spinner></mat-spinner>
</div>
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="number">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Number</th>
<td mat-cell *matCellDef="let invoice">{{invoice.number}}</td>
</ng-container>
<ng-container matColumnDef="reference">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Reference</th>
<td mat-cell *matCellDef="let invoice">{{invoice.reference}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="tableColumns"></tr>
<tr mat-row *matRowDef="let row; columns: tableColumns">
</table>
<mat-paginator [length]="dataSource.length" [pageSize]="25" [pageSizeOptions]="[5, 10, 25, 50]"></mat-paginator>
然后,您的函数应在编码时添加页面前缀,或在解码时移除页面前缀。
[
'GETvar' => 'tx_myext_p1gallery[page]',
'userFunc' => SomeClass::class . '->somefunction'
],