草庐IT

Zend_View

全部标签

php - 如何在资源/ View 目录 Laravel 中创建文件

我正在使用Laravel5.0,如果它没有像这样退出,我正在尝试创建一个Viewif(view()->exists($moduleName.$getCategoryNameToLowerCase)){//ifexistreturntheviewreturnview($moduleName.$getCategoryNameToLowerCase);}else{//elsecreateaviewandreturnit;fopen(app_path('../resources/','views/'.$moduleName.'.'.$getCategoryNameToLowerCase.'.b

php - 将数据从 Controller 传递到 Blade View laravel

我正在尝试通过href将参数发送到从事件列表到事件页面的页面。我的路线是Route::get('eventpage','EventController@index')->name('eventpage');我的事件Controller是query('id');$event=DB::table('events')->where('id',$id)->get();$pics=DB::table('pictures')->where('event_id',$id)->get();$n=count($pics);//thenumberofpicturesforaparticulareventr

php - 如何在 laravel Blade View 上定义变量数组?

我这样尝试:@foreach($categoriesas$category)@php$category[]=$category->name@endphp@endforeach{{implode(",",$category)}}如果执行代码,存在错误:undefinevariablecategory我该如何解决? 最佳答案 你可以简单地使用Laravel集合{{$categories->pluck('name')->implode(',')}}或者如果你想在foreach中这样做@php($names=[])@foreach($cat

php - LARAVEL - 未找到基表或 View : 1146 Table doesn't exist (SQL: select * from )

这个问题在这里已经有了答案:DBquerytakingwrongtablenameonlaravel[duplicate](1个回答)Laravel-Database,TableandColumnNamingConventions?(4个答案)关闭去年。我有一个Mysql数据库minho.win和一个名为utilizadores的表。我创建了一个模型类phpartisanmake:modelUtilizador当我执行phpartisantinker然后执行App\Utilizador::all()时,我收到此错误:Illuminate\Database\QueryExceptionw

php - View 找不到变量(laravel)

我的Controller中有以下操作:publicfunctionviewPost($id){$current_post=forum_post::with('replies')->where('id',$id)->get();returnview('forumViewPost',['currentPost',$current_post]);}然后我有以下看法:@extends('layout.app')@section('content'){{$currentPost->nickname}}Member{{$currentPost->content}}June19,2017ReplyS

php - undefined variable : editor (View:/home/marco/prova/resources/views/home. blade.php)

我有一个问题,Blade找不到变量:编辑器。这是我的Controller的功能。publicfunctionHomeText(){$data=[];$data['editor']=Editore::get();returnview('home')->with($data);}这些是文件blade.php中的说明:@foreach($editoras$editore){{$editore->id_editore,$editore->nome_editore}}@endforeach错误是什么?我希望你能帮助我!我是Laravel的新手,我想了解我哪里错了。 最

php - Zend 框架 : How do you set your layout directory in a modular application?

我要实现的目录结构是这样的:application/default/views/layouts/layout.phtmlapplication/default/views/scripts/index/index.phtmlapplication/admin/views/layouts/layout.phtmlapplication/admin/views/scripts/index/index.phtmllibrary/Zendconfig/config.inipublic/index.php(bootstrap)但我不知道如何让Zend在我的每个模块中找到我的layout.phtml

PHP Zend Framework - Zend_Config 和全局状态

我正在评估Zend_Config_Ini与使用简单常量文件相比的优势。例如-define('DB_HOST',localhost);//versus$config=newZend_Config_Ini('/path/to/config.ini','staging');echo$config->database->params->host;//prints"dev.example.com"唯一的问题是$config不是全局可访问的。那么接下来就需要使用Zend_Registry来存储供应用使用,而不必每次都启动。这似乎增加了比需要更多的复杂性……我是不是遗漏了什么或者Zend_Confi

php - Zend_Form 和 Zend_Filter

如何在重新填充之前禁用Zend_Form中的过滤? 最佳答案 您不能禁用它们。你可以这样做:$filters=$form->getElementFilters();$form->setElementFilters(array());$form->populate($data);$form->setElementFilters($filters);但是,afaikZend_Form只会在您从表单中获取值时过滤值,而不是在您填充表单时过滤值,因此以上内容毫无意义。如果您追求原始值,请使用$form->getUnfilteredValue

php - 更改 Zend Framework 中的 .phtml 扩展名(仅限模块)

ZendFramework中模板文件的标准扩展名是.phtml...我需要在一个特定模块中将它们更改为.js...任何人都可以帮忙...我最好将其更改为Controller级别...非常感谢... 最佳答案 在你的Controller中:publicfunctioninit(){$this->getHelper('viewRenderer')->setViewSuffix('js');}如果您需要将它应用到模块中的所有Controller,您应该将它放在用于该模块的抽象Controller类中,并让该模块中的每个Controller