草庐IT

append_view_path

全部标签

php - Laravel 4 - 如何在没有父 View 的情况下渲染 @extends ('parent' 的 subview

好吧,标题可能有点令人困惑,所以让我来说明一下情况。我在Blade中有一个基本模板,其中包含基本的html和导航,如下所示:@section('title')PageTitle@showPage1Page2Page3Page4@yield('content')然后是每个页面的一堆subview,如下所示:@extends('layouts.base')@section('title')Page1@stop@section('content')Page1somecontenthere@stop现在,我想要的是能够有条件地忽略@extends(),这样我就可以返回一个只是subview的V

php - htaccess : redirect an image path to a PHP script

我想要以下图片网址http://www.example.com/image-provider/article/1275449_inline3_scale_700xauto.jpg将被重定向到将实际生成内容的以下PHP脚本http://www.example.com/image-provider?url=article/1275449_inline3_scale_700xauto.jpg我在我的.htaccess中尝试了以下语法RewriteCond%{REQUEST_FILENAME}!-fRewriteRule^/image-provider/(.*)$image-provider?

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