mirror of
https://github.com/flextype/flextype.git
synced 2025-08-15 01:24:25 +02:00
- fix bug "The method urlFor() does not exist"
This commit is contained in:
@@ -47,14 +47,14 @@ class EntriesController extends Controller
|
||||
'last' => Arr::last($id),
|
||||
'links' => [
|
||||
'entries' => [
|
||||
'link' => $this->router->urlFor('admin.entries.index'),
|
||||
'link' => $this->router->pathFor('admin.entries.index'),
|
||||
'title' => __('admin_entries'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
],
|
||||
'buttons' => [
|
||||
'create' => [
|
||||
'link' => $this->router->urlFor('admin.entries.add') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'link' => $this->router->pathFor('admin.entries.add') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'title' => __('admin_create_new_entry'),
|
||||
'attributes' => ['class' => 'float-right btn']
|
||||
]
|
||||
@@ -91,12 +91,12 @@ class EntriesController extends Controller
|
||||
'fieldsets' => $fieldsets,
|
||||
'links' => [
|
||||
'entries' => [
|
||||
'link' => $this->router->urlFor('admin.entries.index'),
|
||||
'link' => $this->router->pathFor('admin.entries.index'),
|
||||
'title' => __('admin_entries'),
|
||||
'attributes' => ['class' => 'navbar-item']
|
||||
],
|
||||
'entries_add' => [
|
||||
'link' => $this->router->urlFor('admin.entries.add') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'link' => $this->router->pathFor('admin.entries.add') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'title' => __('admin_create_new_entry'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
@@ -175,7 +175,7 @@ class EntriesController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_entry_was_not_created'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entries.index') . '?entry=' . $data['parent_entry']);
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entries.index') . '?entry=' . $data['parent_entry']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,12 +210,12 @@ class EntriesController extends Controller
|
||||
'menu_item' => 'entries',
|
||||
'links' => [
|
||||
'entries' => [
|
||||
'link' => $this->router->urlFor('admin.entries.index'),
|
||||
'link' => $this->router->pathFor('admin.entries.index'),
|
||||
'title' => __('admin_entries'),
|
||||
'attributes' => ['class' => 'navbar-item']
|
||||
],
|
||||
'entries_type' => [
|
||||
'link' => $this->router->urlFor('admin.entries.type') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'link' => $this->router->pathFor('admin.entries.type') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'title' => __('admin_type'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
@@ -249,7 +249,7 @@ class EntriesController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_entry_was_not_moved'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entries.index') . '?entry=' . implode('/', array_slice(explode("/", $entry_name), 0, -1)));
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entries.index') . '?entry=' . implode('/', array_slice(explode("/", $entry_name), 0, -1)));
|
||||
}
|
||||
|
||||
public function move($request, $response, $args)
|
||||
@@ -278,12 +278,12 @@ class EntriesController extends Controller
|
||||
'menu_item' => 'entries',
|
||||
'links' => [
|
||||
'entries' => [
|
||||
'link' => $this->router->urlFor('admin.entries.index'),
|
||||
'link' => $this->router->pathFor('admin.entries.index'),
|
||||
'title' => __('admin_entries'),
|
||||
'attributes' => ['class' => 'navbar-item']
|
||||
],
|
||||
'entries_move' => [
|
||||
'link' => $this->router->urlFor('admin.entries.move'),
|
||||
'link' => $this->router->pathFor('admin.entries.move'),
|
||||
'title' => __('admin_move'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
@@ -306,7 +306,7 @@ class EntriesController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_entry_was_not_moved'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entries.index') . '?entry=' . $data['parent_entry']);
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entries.index') . '?entry=' . $data['parent_entry']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,12 +322,12 @@ class EntriesController extends Controller
|
||||
'menu_item' => 'entries',
|
||||
'links' => [
|
||||
'entries' => [
|
||||
'link' => $this->router->urlFor('admin.entries.index'),
|
||||
'link' => $this->router->pathFor('admin.entries.index'),
|
||||
'title' => __('admin_entries'),
|
||||
'attributes' => ['class' => 'navbar-item']
|
||||
],
|
||||
'entries_type' => [
|
||||
'link' => $this->router->urlFor('admin.entries.rename') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'link' => $this->router->pathFor('admin.entries.rename') . '?entry=' . $this->getEntriesQuery($request->getQueryParams()['entry']),
|
||||
'title' => __('admin_rename'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
@@ -349,7 +349,7 @@ class EntriesController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_entry_was_not_created'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entries.index') . '?entry=' . $data['parent_entry']);
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entries.index') . '?entry=' . $data['parent_entry']);
|
||||
}
|
||||
|
||||
public function deleteProcess($request, $response, $args)
|
||||
@@ -363,7 +363,7 @@ class EntriesController extends Controller
|
||||
$this->flash->addMessage('error', __('admin_message_entry_was_not_deleted'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entries.index') . '?entry=' . $entry_name_current);
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entries.index') . '?entry=' . $entry_name_current);
|
||||
}
|
||||
|
||||
public function duplicateProcess($request, $response, $args)
|
||||
@@ -374,7 +374,7 @@ class EntriesController extends Controller
|
||||
|
||||
$this->flash->addMessage('success', __('admin_message_entry_duplicated'));
|
||||
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entries.index') . '?entry=' . implode('/', array_slice(explode("/", $entry_name), 0, -1)));
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entries.index') . '?entry=' . implode('/', array_slice(explode("/", $entry_name), 0, -1)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -511,17 +511,17 @@ class EntriesController extends Controller
|
||||
'menu_item' => 'entries',
|
||||
'links' => [
|
||||
'edit_entry' => [
|
||||
'link' => $this->router->urlFor('admin.entries.edit') . '?entry=' . $entry_name,
|
||||
'link' => $this->router->pathFor('admin.entries.edit') . '?entry=' . $entry_name,
|
||||
'title' => __('admin_content'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
],
|
||||
'edit_entry_media' => [
|
||||
'link' => $this->router->urlFor('admin.entries.edit') . '?entry=' . $entry_name . '&media=true',
|
||||
'link' => $this->router->pathFor('admin.entries.edit') . '?entry=' . $entry_name . '&media=true',
|
||||
'title' => __('admin_media'),
|
||||
'attributes' => ['class' => 'navbar-item']
|
||||
],
|
||||
'edit_entry_source' => [
|
||||
'link' => $this->router->urlFor('admin.entries.edit') . '?entry=' . $entry_name . '&source=true',
|
||||
'link' => $this->router->pathFor('admin.entries.edit') . '?entry=' . $entry_name . '&source=true',
|
||||
'title' => __('admin_source'),
|
||||
'attributes' => ['class' => 'navbar-item']
|
||||
],
|
||||
|
@@ -44,7 +44,7 @@ class InformationController extends Controller
|
||||
'password_hash_installed' => $password_hash_installed,
|
||||
'links' => [
|
||||
'information' => [
|
||||
'link' => $this->router->urlFor('admin.information.index'),
|
||||
'link' => $this->router->pathFor('admin.information.index'),
|
||||
'title' => __('admin_information'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
],
|
||||
|
@@ -20,7 +20,7 @@ class PluginsController extends Controller
|
||||
'menu_item' => 'plugins',
|
||||
'links' => [
|
||||
'plugins' => [
|
||||
'link' => $this->router->urlFor('admin.plugins.index'),
|
||||
'link' => $this->router->pathFor('admin.plugins.index'),
|
||||
'title' => __('admin_plugins'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
],
|
||||
|
@@ -55,7 +55,7 @@ class SettingsController extends Controller
|
||||
'themes' => $themes,
|
||||
'links' => [
|
||||
'settings' => [
|
||||
'link' => $this->router->urlFor('admin.settings.index'),
|
||||
'link' => $this->router->pathFor('admin.settings.index'),
|
||||
'title' => __('admin_settings'),
|
||||
'attributes' => ['class' => 'navbar-item active']
|
||||
]
|
||||
@@ -69,7 +69,7 @@ class SettingsController extends Controller
|
||||
'settings_clear_cache' => [
|
||||
'type' => 'action',
|
||||
'id' => 'clear-cache',
|
||||
'link' => $this->router->urlFor('admin.settings.clear-cache'),
|
||||
'link' => $this->router->pathFor('admin.settings.clear-cache'),
|
||||
'title' => __('admin_clear_cache'),
|
||||
'attributes' => ['class' => 'float-right btn']
|
||||
]
|
||||
@@ -99,13 +99,13 @@ class SettingsController extends Controller
|
||||
$this->flash->addMessage('success', __('admin_message_settings_was_not_saved'));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.settings.index'));
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.settings.index'));
|
||||
}
|
||||
|
||||
public function clearCache($request, $response, $args)
|
||||
{
|
||||
Cache::clear();
|
||||
$this->flash->addMessage('success', __('admin_message_cache_files_deleted'));
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.settings.index'));
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.settings.index'));
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ class UsersController extends Controller
|
||||
]
|
||||
);
|
||||
} else {
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.users.registration'));
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.users.registration'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class UsersController extends Controller
|
||||
'plugins/admin/views/templates/users/registration.html'
|
||||
);
|
||||
} else {
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entires.index'));
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entires.index'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class UsersController extends Controller
|
||||
'role' => 'admin',
|
||||
'state' => 'enabled'])
|
||||
)) {
|
||||
return $response->withRedirect($this->container->get('router')->urlFor('admin.entries.index'));
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('admin.entries.index'));
|
||||
} else {
|
||||
//return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user