草庐IT

routing_entry

全部标签

php - 错误 : You must use the "set" method to update an entry fix?

我使用codeigniter作为我的PHP框架,当我提交我的fromtopost到我的数据库时,我总是收到这个错误。Youmustusethe"set"methodtoupdateanentry我不太确定这是什么意思,从我看过的其他帖子来看,每个人都说数据映射器需要为对象分配一个值。由于我是新手,有人可以给我更好的解释吗。这是我的代码,它说我有错误:classAdd_bookextendsCI_Model{publicfunctionadd_book($data){$this->db->insert('ST_ITM',$data);}}?>谢谢。 最佳答案

php - 拉维尔 5.2 : Creating a custom route function - extending route

基本上,我想创建自己的Route::custom函数。这是因为我一直在为整个站点的多个路由使用相同的组和中间件(我还使用带有子域的模块,所以我们正在谈论为每个路由节省5-6行代码)我只想让Route::custom调用两个或三个其他Route函数。例如:Route::Module('forum')替换为Route::group(['middleware'=>['web','auth'],'domain'=>'forum.'.env('SITE_DOMAIN','example.com')],function(){Route::group(['middleware'=>'permissi

php - Zend 框架 : Removing default routes

我正在使用ZendFW1.9.2,想禁用默认路由并提供我自己的路由。我真的不喜欢默认的/:controller/:action路由。这个想法是在初始化时注入(inject)路由,当请求不能路由到注入(inject)的路由之一时,它应该被转发到错误Controller。(通过使用默认注册的Zend_Controller_Plugin_ErrorHandler)一切正常,直到我使用$router->removeDefaultRoutes();禁用了默认路由;当我这样做时,错误Controller不再将未路由的请求路由到错误Controller。相反,它将所有未路由的请求路由到默认Contr

php artisan route::list 给我一个错误:试图获取非对象的属性

当我输入时phpartisanroute:list我明白了Tryingtogetpropertyofnon-object当我输入时phpartisanroute:list-v我明白了Exceptiontrace:()at/home/vagrant/Code/app/CategorySettings.php:31Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()at/home/vagrant/Code/app/CategorySettings.php:31App\CategorySettings->getDefa

PHP 和 SwiftMailer : Decorator Plugin 'stuck' on first entry.

我在使用SwiftMailer的最新主要版本时遇到问题,装饰器插件只会替换消息中列表中第一个电子邮件地址的占位符,然后在所有后续电子邮件中使用相同的数据-无论电子邮件地址。例如如果...$replacements[test@test.com]=array('{firstname}'=>'Jeff','{age}'=>'32');$replacements[example@example.com]=array('{firstname}'=>'Mary','{age}'=>'86');第一封电子邮件可能会说...“嗨,杰夫,你今年32岁”。然后第二封电子邮件应该说“嗨,玛丽,你86岁了”。

php - 我可以向 Laravel 中的 Route::group 添加参数,但在分派(dispatch)到 Laravel 中的路由之前将其删除吗?

我正在使用Laravel4创建由每个客户的accountname命名空间的API。每个客户都有自己的相同数据库。所以Foocorp应该进行如下所示的api调用:http://api.example.com/Foocorp/users/5Barcorpapi调用如下所示http://api.example.com/Barcorp/users/5出于业务/品牌原因,我必须在URL中包含帐户名称,因此我无法从URL路由中删除此参数。这是我用来尝试从路由中提取帐户名称、验证它是否处于事件状态并指向他们的数据库的过滤器。我希望删除accountname参数,这样我就可以编写我所有的Control

php - Laravel 4 重定向:: Action () "Route not defined"

我目前在使用Laravel4时遇到问题。我想将slugs用于论坛类别和论坛主题(slugs是独一无二的)。为了确定用户是在一个类别中还是在一个主题中,我有这条路线:Route::get('forum/{slug}',function($slug){$category=ForumCategory::where('slug','=',$slug)->first();if(!is_null($category))returnRedirect::action('ForumCategoryController@findBySlug',array('slug'=>$slug));else{$top

php - 拉维尔 : is it possible to set a controller dynamically for a route?

那么,假设我有一个简单的Controller来处理书籍。App\Http\Controllers\SimpleBooksController在routes.php中,我为它注册了一个路由:Route::get('books/{id}','SimpleBooksController@doSimpleStuff');但是书的世界并没有那么简单。所以我想要另一个Controller来处理真正复杂的书籍内容。在我的脑海里,我想象这样的东西会非常有用:classComplexBooksControllerextendsSimpleBooksController以便子类未明确处理的路由回退到父类。

php - 错误 : No route found for "GET/app/example"

我刚刚使用SymfonyInstaller在我的Windows10笔记本电脑上创建了一个Symfony应用程序.然后,我开始了:phpapp/consoleserver:run然后,我打开了http://localhost:8000/app/example如文档中所述,但我收到以下错误消息:ERROR-UncaughtPHPExceptionSymfony\Component\HttpKernel\Exception\NotFoundHttpException:"Noroutefoundfor"GET/app/example""atC:\Users\JVerstry\morepath\

php - Symfony2 "Parameter ""for route ""must match "[^/]++"(""given) to generate a corresponding URL."

我有这个路线文件:indexRechercheZones:path:/gestionzonestechniquesdefaults:{_controller:MySpaceGestionEquipementsTechniquesBundle:GestionZonesTechniques:indexZonesTechnique}requirements:methods: GETmodifierZones:path:/gestionzonestechniques/modifier/{nom}defaults:{_controller:MySpaceGestionEquipementsTec