草庐IT

view_table

全部标签

php - 将javascript变量从 View 发送到Codeigniter中的 Controller

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:HowtogetJavaScriptfunctiondataintoaPHPvariable我在order.phpView中有一个javascript变量,我想将该变量发送到Controller,然后发送到模型以将其写入数据库。例如:varmyOrderString="something"到order.phpController。如何做到这一点?

php - Codeigniter:连接 3 个表并在 View 中显示数据

所以我想加入3个表。我正在用Codeigniter构建一个应用程序,我有3个表客户:-id-电话号码-医院编号-smc_status-testing_center_id医院-id-姓名测试中心-id-姓名在模型中,我有这个:publicfunctionget_clients(){if($slug===FALSE){$this->db->select('clients.*');$this->db->from('clients');$this->db->join('hospital','clients.id=hospital.id');$this->db->join('testing_ce

php - Laravel Blade View - undefined variable : errors

当访问我的laravel应用程序的登录页面时,我得到一个Undefinedvariable:errors(View:D:\PhpstormProjects\laravel\resources\views\login.blade.php)错误。根据http://laravel.com/docs/master/validation#error-messages-and-views,$errors应该总是自动设置:So,itisimportanttonotethatan$errorsvariablewillalwaysbeavailableinallofyourviews,oneveryre

javascript - 使用 cookie 更新独特的 View

我有一个论坛线程文件thread.php获取主题ID信息。例子:thread.php?id=781我正在尝试创建一个独特的View设置,但我不知道这是否真的可行:thread.php:topicId=;if($.cookie("unique"+topicId)!=="1"){$.cookie("unique"+topicId,1,{expires:1000,path:'/'});//createcookieifitdoesn'texist$.post('unique.php',{id:topicId});//updatethreaduniqueviews}unique.php//con

php - Laravel/Lumen:View::share() 替代方案?

我已经使用Laravel很长时间了,现在我正在使用Lumen编写一个微型项目。我需要将一些变量传递给所有View。在Laravel中,我可以在中间件或Controller的构造函数中使用View::share()函数,但在Lumen中没有View类,它看起来像所有View功能只是View::make()的别名。有没有办法将变量共享给所有View? 最佳答案 出于性能原因,Lumen不像Laravel那样注册门面和服务提供者。虽然Laravel门面包含在Lumen中,但只有一些是别名的(View不是其中之一),并且只有当你取消注释$a

php - 可以在 View 中加载的数据库驱动菜单

我使用Controller创建了一个数据库驱动的菜单,HomeControllerextendsController,在Controller的构造函数中加载菜单。HomeController.phpclassHomeControllerextendsController{publicfunction__construct(){parent::__construct();$this->middleware('auth');}publicfunctionindex(){$data['menu']=$this->menu;returnview('home',$data);}}Controll

php - Laravel 5 Eloquent 关系 : can't modify/overwrite relationship table property

我正在使用Laravel5的belongsToMany方法使用中间数据透视表定义相关表。我的应用程序使用Eloquent模型Tour和TourCategory。在Tour模型中,我有:namespaceApp;useIlluminate\Database\Eloquent\Model;classTourextendsModel{publicfunctioncats(){return$this->belongsToMany('App\TourCategory','tour_cat_assignments','tour_id','cat_id');}}在我的Controller中,我使用L

php - 从 Controller 到 View

我正在努力创建我自己的非常简单的MVC,并且正在集思广益地想出从Controller到View的方法。这涉及将变量从一个类发送到一个普通的旧PHP页面。我确信之前已经讨论过了,但我想看看人们能想出什么样的想法。//thisfilewouldbe/controller/my_controller.phpclassMy_Controller{functionsomeFunction(){$var='HelloWorld';//howdowegetvartoourviewfileinthedocumentroot?//cool_view.php}} 最佳答案

php - 扩展构建器中的 "Map to existing tables"在 TYPO3 中显示奇怪的问题

在我的扩展MyExt中,我将模型Page映射到TYPO3中的pages表。首先,它向我显示了typemismatch错误,无论如何我还是继续并保存了它。会发生以下情况:我的页面树变成了这样:我的新记录表只显示UID,不显示标题:我的页面编辑变成这样:在我的MyExt/Configuration/TypoScript/setup.txt中我有这个:config.tx_extbase.persistence.classes{Tx_MyExt_Domain_Model_Page{mapping{tableName=pages}}}这是一个错误吗?或者我做错了什么?这是我的/Domain/Mo

php - Codeigniter-将 View 缓存成 View

我想知道是否可以缓存在另一个View中加载的View。我愿意:view.php:load->view('modules/new_view');?>所以view.php内部需要一个新View,我可以缓存views/modules/new_view.php内容吗? 最佳答案 Codeigniter有WebPageCachingCodeIgniterletsyoucacheyourpagesinordertoachievemaximumperformance.AlthoughCodeIgniterisquitefast,theamount