草庐IT

view_config

全部标签

php - Twig调试(我没有config.yml)

在……很长一段时间后,我又回到了PHP游戏中。我正在查看Twig,需要了解更多正在发生的事情。我发现一些文本需要进入我的config.yml文件。警告:它不在我的系统上。它是随Twig版本一起提供的,还是我也必须安装Symfony?有点迷路了。干杯。编辑:我只需要{{dump(var)}}即可工作。httpd错误日志告诉我:PHPfatalerror:未捕获的异常“Twig_Error_Syntax”,消息为“函数“转储”不存在我正在像这样设置我的Twig环境:$twig=newTwig_Environment($loader,array('cache'=>'/tmp','debug'

php - Laravel 中的 Guzzle 客户端 : InvalidArgumentException: "No method is configured to handle the form_params config key"

我正在尝试使用Guzzle客户端向API发送请求,但收到一条错误消息,InvalidArgumentException:"Nomethodisconfiguredtohandletheform_paramsconfigkey"这是我试过的:$response=$this->guzzle->post("https://example.com",['form_params'=>['client_id'=>$this->client_id,'authorization_code'=>$this->authorization_code,'decoder_query'=>$this->reque

php - Yii2 - 在 View 的 index.php 中渲染 _search.php 文件

我在Yii2中有一个名为eventos的View文件夹。此View是一个图片库。_view2.php用于向公众显示图像。它工作得很好。但现在我想在_view2.php中创建一个全局搜索输入文本。我已经有一个用于显示图像的GridView小部件,但我不想使用$searchmodel框,所以我禁用了它们。我想要的是在_view2.php文件中呈现只有一个输入字段的_search.php文件我的问题是在_view2.php文件中呈现_search.php。这是_view2.php的代码:$dataProvider,'filterModel'=>$searchModel,'showOnEmpt

php - 将数据从 View 传递到 Controller (codeigniter)

我正在尝试使用从View到Controller的链接传递一些数据。Controller:publicfunctiondetails(){echo$this->input->post('data_id');$data['details']=$this->wapi_db->details($this->input->post('data_id'));$data['latest_news']=$this->wapi_db->latest_news();$data['main_content']="category/details";$this->load->view('includes/te

php - 如何将 php 变量从 View (html)发送到 Controller

这是我的html代码。我想将“$category_edit->c_name”值传递给我的Update()Controller。我从另一个Controller获取“$category_edit”变量。我正在使用CodeIgniter框架。">ParentCategory:id.'">';echo$category_edit->p_name;echo'';?>Categoryc_name;?>"id="category_name"value="c_name;?>">Update这是我的update()Controller。我收到错误:undefinedvariable:category_e

php - 类 path.config 不存在 - Lumen 5.2

我在添加GoogleMaps包时遇到了一些问题作者:alexpechkarev链接:https://alexpechkarev.github.io/google-maps/流明框架版本5.2我将ServiceProvider和Facade添加到我的app.php中:$app->register(GoogleMaps\ServiceProvider\GoogleMapsServiceProvider::class);class_alias(GoogleMaps\Facade\GoogleMapsFacade::class,'GoogleMaps');但是当我转到我的命令行并磁带:phpa

php - 在布局中的 Laravel 5.3 View 中包含 PHP 变量

基于Laravel通知电子邮件模板,这是我正在尝试做的事情。我尝试为电子邮件设计一个带有变量的布局,以便在我的布局中定义一些样式,但可以在我的电子邮件View中访问。这是一个例子:emails/layout.blade.php[...]@php$style=['body'=>'font-size:12px;color:#000;','paragraph'=>'font-size:10px;color:#eee;'];@endphp@yield('content')在我的电子邮件View中:@extends('emails.layout')@section('content')Hithe

php - 如何在 codeigniter 的核心函数中加载 View 文件

我正在尝试加载application/core/MY_Controller.php中的View文件,但它给出如下。Message:Undefinedproperty:Edustaticlanding::$loadFilename:core/MY_Controller.phpMY_Controller.php中函数如下functionmenu(){$arrr=array();return$arrdata['menu']=$this->load->view('menu',$arrr,true);}我在Controller(Edustaticlanding.php)中调用这个函数如下。fun

php - 了解 Laravel View Composer : Where does my view composer belong?

我正在阅读Laravel文档以加深理解,这将是我第二次遇到一些困惑。不久前,我正在观看一个Laracasts视频,其中我们在AppServicesProvider注册方法中实现了一个Viewcomposer。看起来像这样:publicfunctionregister(){view()->composer('layouts.sidebar',function($view){$archives=\App\Post::archives();$tags=\App\Tag::has('posts')->pluck('name');$view->with(compact('archives','t

php - 返回或回显 View 有什么区别?返回 View 比 echo View 说话的时间更长

加载View的最佳做法是什么。文档说在此处加载Viewhttps://laravel.com/docs/5.7/views以下是我的代码:if(isset($results['status'])){$error[]=$results['msg'];$request->session()->flash('message.level','danger');$request->session()->flash('message.content',$error);}else{if(view()->exists('import.device.results')){echoview('import