1 | <?php |
||
2 | |||
3 | use Ffcms\Templex\Url\Url; |
||
0 ignored issues
–
show
|
|||
4 | |||
5 | /** @var Apps\Model\Admin\User\FormUserUpdate $model */ |
||
6 | /** @var \Ffcms\Templex\Template\Template $this */ |
||
7 | |||
8 | $this->layout('_layouts/default', [ |
||
9 | 'title' => __('Manage user'), |
||
10 | 'breadcrumbs' => [ |
||
11 | Url::to('main/index') => __('Main'), |
||
12 | Url::to('application/index') => __('Applications'), |
||
13 | Url::to('user/index') => __('User list'), |
||
14 | __('Manage user') |
||
15 | ] |
||
16 | ]); |
||
17 | ?> |
||
18 | |||
19 | <?php $this->start('body') ?> |
||
20 | <?= $this->insert('user/_tabs') ?> |
||
0 ignored issues
–
show
Are you sure the usage of
$this->insert('user/_tabs') targeting League\Plates\Template\Template::insert() seems to always return null.
This check looks for function or method calls that always return null and whose return value is used. class A
{
function getObject()
{
return null;
}
}
$a = new A();
if ($a->getObject()) {
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
Loading history...
|
|||
21 | |||
22 | <h1><?= __('Manage user') ?></h1> |
||
23 | |||
24 | <?php $form = $this->form($model) ?> |
||
25 | <?= $form->start() ?> |
||
26 | |||
27 | <?= $form->fieldset()->text('email', null, __('Specify user email')) ?> |
||
28 | <?= $form->fieldset()->text('login', null, __('Specify user login')) ?> |
||
29 | <?= $form->fieldset()->text('newpassword', null, __('Specify new user password if you want to change it! Less empty field to save current')) ?> |
||
30 | <?= $form->fieldset()->select('role_id', ['options' => $model->getRoleList(), 'optionsKey' => true]) ?> |
||
31 | <?= $form->field()->hidden('approve_token') ?> |
||
32 | <?= $form->fieldset()->boolean('approved', null, __('Set if user is approved or not')) ?> |
||
33 | |||
34 | <?php if ($model->_user->getId() !== null): ?> |
||
35 | <div class="row mt-3"> |
||
36 | <div class="col-md-3"> |
||
37 | <div class="text-right"><strong><?= __('Profile preview') ?></strong></div> |
||
38 | </div> |
||
39 | <div class="col-md-9"> |
||
40 | <a href="<?= \App::$Alias->scriptUrl . '/profile/show/' . $model->_user->id ?>" target="_blank"><?= __('View profile on website') ?></a> |
||
41 | </div> |
||
42 | </div> |
||
43 | <div class="row mt-3 mb-3"> |
||
44 | <div class="col-md-3"> |
||
45 | <div class="text-right"><strong><?= __('Profile data') ?></strong></div> |
||
46 | </div> |
||
47 | <div class="col-md-9"> |
||
48 | <?= Url::a(['profile/update', [$model->_user->profile->id]], __('Edit profile data')); ?> |
||
49 | </div> |
||
50 | </div> |
||
51 | <?php endif; ?> |
||
52 | <?= $form->button()->submit(__('Save'), ['class' => 'btn btn-primary']) ?> |
||
53 | <?= $form->button()->cancel(__('Cancel'), ['class' => 'btn btn-secondary', 'link' => ['user/index']]) ?> |
||
54 | <?= Url::a(['user/clear', [$model->_user->id]], __('Clear'), ['class' => 'btn btn-warning']) ?> |
||
55 | <?= Url::a(['user/delete', [$model->_user->id]], __('Delete'), ['class' => 'btn btn-danger']) ?> |
||
56 | |||
57 | <?= $form->stop() ?> |
||
58 | |||
59 | <?php $this->stop() ?> |
||
60 |
Let?s assume that you have a directory layout like this:
and let?s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: