routes

Problem with routes and mod-rewrite (if not absolute i don't get CSS, JS or images)

99封情书 提交于 2019-12-24 22:16:09
问题 i updated the code from my website to a 'better' veersion i think, it works fine but when i try to implement the friendly URL and load it, works, but with no CSS, Javascript or images, but if i corret the routes for the css to http://website/css/style.css (instead of ./css/style.css) it i do see the CSS properly loaded, any idea why? Example: http://keepyourlinks.com/link1.php?id=25 VS http://keepyourlinks.com/keep/25/series-yonkis (i updated the route of the CSS, but the Javascript is

PHP Zend Route Config.ini - similar patterns

只谈情不闲聊 提交于 2019-12-24 21:27:01
问题 I'm using a configuration file to route my requests in my application. I have the following entries: routes.deal.route = "deal/:id/*" routes.deal.defaults.controller = "deal" routes.deal.defaults.action = "index" routes.deal.reqs.id = "\d+" routes.deal.route = "deal/buy/:id/*" routes.deal.defaults.controller = "deal" routes.deal.defaults.action = "buy" routes.deal.reqs.id = "\d+" here's what the behavior I'm looking for: mysite.com/deal/75 --- this will display the details of Deal 75

How to view a CakePHP plugin view

萝らか妹 提交于 2019-12-24 19:28:26
问题 I've been going around and around reading the docs and doing searches, but there isn't a clear explanation of how to reach a plugin view using a web browser. My plugin is called MediaManager. I have CakePlugin::loadAll(); in my bootstrap.php file. I have CakePlugin::routes(); in my routes.php file. I have MediaManagerAppController.php and MediaManagerAppModel.php in their respective folders, and I have a MediaController.php file with a MediaManager class that extends MediaManagerAppController

How can i register multiple middleware permissions in routegroup?-Laravel

核能气质少年 提交于 2019-12-24 19:00:21
问题 I have 3 roles roles, admin, tutor and student. i want to place them in 3 different goups, i however want the admin to be in all the groups. I have tried different methods to add the admin to other routes but it's not working. How can i make admin use all routes in tutor's middleware? Here is my code AdminMiddleware , similar to all the others class AdminMiddleware { public function handle($request, Closure $next) { if(Auth::check() && Auth::user()->isRole()=="admin") { return $next($request)

Codeigniter Routes for filename with extension

老子叫甜甜 提交于 2019-12-24 18:38:52
问题 I am using codeigniter and its routes system successfully with some lovely regexp, however I have come unstuck on what should be an easy peasy thing in the system. I want to include a bunch of search engine related files (for Google webmaster etc.) plus the robots.txt file, all in a controller. So, I have create the controller and updated the routes file and don't seem to be able to get it working with these files. Here's a snip from my routes file: $route['robots\.txt|LiveSearchSiteAuth\.xml

Laravel 5.2 assigning same route to different controller action by conditions

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 16:29:23
问题 I wish to route the same route to different controller base on user type. Such as if (Auth::check() && Auth::user()->is_admin) { Route::get('/profile', 'AdminController@show'); } elseif (Auth::check() && Auth::user()->is_superadmin) { Route::get('/profile', 'SuperAdminController@show'); } But this doesn't work. How can I make it works as what I want? 回答1: You can do this Route::get('/profile', 'HomeController@profile'); // another route Controller public function profile() { if (Auth::check()

Laravel 4 mandatory parameters error

五迷三道 提交于 2019-12-24 16:12:17
问题 Hello im working with laravel 4 in a proyect and it´s not the first time but i have a problem that ive never had before. Some mandatory parameters are missing ("key") to generate a URL for route "register". I dont know how to fix it i've tryed everything i came up with but no results. These are my routes: Route::get('register/{key}',array('before'=>'guest','as'=>'register','uses' => 'UserController@create')); Route::post('register/{key}',array('before'=>'csrf','uses'=>'UserController@store'))

Laravel 4 mandatory parameters error

▼魔方 西西 提交于 2019-12-24 16:02:28
问题 Hello im working with laravel 4 in a proyect and it´s not the first time but i have a problem that ive never had before. Some mandatory parameters are missing ("key") to generate a URL for route "register". I dont know how to fix it i've tryed everything i came up with but no results. These are my routes: Route::get('register/{key}',array('before'=>'guest','as'=>'register','uses' => 'UserController@create')); Route::post('register/{key}',array('before'=>'csrf','uses'=>'UserController@store'))

Route Model Binding Not Firing

可紊 提交于 2019-12-24 15:50:37
问题 I have some route/model bindings setup. Around ten of them for various ids. Nothing special going on: $router->get('/notifications/{active_notification_id}/open', 'NotificationsController@open'); $router->bind('active_notification_id', function ($id) { echo 'here'; echo $id; exit; // code }); The binding is not firing at all. Works fine in eight others but for two of them it just doesn't fire. It goes straight to the controller with an empty model which than crashes my code. The crazier thing

rails routes with :id not working

邮差的信 提交于 2019-12-24 14:22:00
问题 I have a model called Schedule that belongs_to a project. A project has_one schedule. I am trying to follow CRUD conventions but having some difficult. I have a page that lists all the projects and has a link next to each project to create a schedule. I started out with the following in my route file: resources :schedules Here's the problem. In the url of the 'new schedule' page there needs to be an :id that refers to the project that the schedule belongs to, that way when the schedule is