草庐IT

framework-name

全部标签

php - 在 PHP 脚本中加载 Zend Framework 及其应用程序

我需要在PHP脚本中找到ZendFramework及其MVC应用程序,这样我就可以做一些模型来查询数据库。框架和一些库是这样加载的(脚本是别人创建的):/**InitialiseZend*/define('BRIDGE_BASE_DIR',dirname(__FILE__));set_include_path(get_include_path().PATH_SEPARATOR.BRIDGE_BASE_DIR.'/../library');require_once('Zend/Loader/Autoloader.php');require_once'Zend/Config/Ini.php

php - Zend Framework 2 - 注释形式 - 绑定(bind)不起作用

我正在使用AnnotationForms,并且我将教程中的标准编辑操作更改为使用Annotation而不是标准表单。除了$form->bind()没有填写值外,一切正常。表单字段保持为空。我检查了应该绑定(bind)的变量,它已设置且看起来不错。这是我的操作:$id=(int)$this->getEvent()->getRouteMatch()->getParam('id');if(!$id){return$this->redirect()->toRoute('album',array('action'=>'add'));}$album=$this->getEntityManager(

php - 将模型名称作为函数中的参数传递并使用其方法,如 "$this-> $model_name->method()"codeigniter

我如何创建一个方法来用特定模型填充读取特定表格的下拉列表,然后获取该表格的特定列来填充下拉列表?例如,如果我有一个模范人物我有functionget_all_id($id,$table){$this->db->from($table);$this->db->order_by($id,"asc");$q=$this->db->get();return$q;}然后,如果我需要填写一个带有姓氏字段的下拉列表...我会将其用作$this->load->model('person_model');$row=$this->person_model->get_all_id('id_person','

php xmlParsePITarget : invalid name prefix 'xml' error

有人能帮我理解(并修复这个错误)吗?错误如下:警告:simplexml_load_file():/home/jeffreycwitt/webapps/lombardpress_instances/petrusplaoul/lombardpress/phpfunctions/../../projectfiles/GitTextfiles/lectio1/lectio1.xml:2:解析器警告:xmlParsePITarget:home/jeffreycwitt/webapps/lombardpress_instances/petrusplaoul/lombardpress/phpfunc

php - 如何将 id 属性添加到 Zend Framework 表单?

我有一个简单的类,它用2个元素扩展Zend_Form:classApplication_Form_PlayerextendsZend_Form{publicfunctioninit(){$this->addElement('text','firstName',array('label'=>$this->getView()->translate('Firstname').'('.$this->getView()->translate('imaginary').')','required'=>true,'filters'=>array('StringTrim'),'validators'=

PHP 特征 : How to resolve a property name conflict?

当一个类使用两个具有同名属性的特征时,如何解决属性名称冲突?例子:name;我试过insteadof(Video::nameinsteadofAudio)和(Video::nameasname2)都没有成功。提前致谢! 最佳答案 你不能,它仅用于方法。但是,只有当值相同时,它们才可以使用相同的属性名称:traitVideo{public$name;functiongetName(){return'Video';}}traitAudio{public$name;functiongetName(){return'Audio';}}cla

php - ERR_NAME_NOT_RESOLVED

有什么想法吗?DocumentRoot"C:/laragon/www/monetize/public/"ServerNamemonetize.appServerAlias*.monetize.appAllowOverrideAllRequireallgrantedApache2.4.27拉拉贡完整版3.1.4window8.1我在Internet选项8.8.8.8和8.8.4.4中设置的DNS 最佳答案 您需要在您的hosts文件中添加一个条目127.0.0.1monetize.applocalhostmonetize.app

php - 尝试在 View 上访问 Auth::user()->name 时尝试获取非对象 [Laravel] 的属性

我正在尝试使用以下方法从View中获取用户名:Auth::user()->name我得到了尝试获取非对象的属性因为Auth::user()是NULL。这怎么可能?laravel生成的导航栏使用相同的方法,并且可以在那里工作。编辑:似乎我什至无法从Controller获得授权用户。Auth::guard('admin')->check();//trueAuth::user();//null有什么想法吗? 最佳答案 好吧,我又想通了,因为我使用了自定义守卫,所以我实际上需要使用:Auth::guard('admin')->user()-

php - 冒号是什么意思(:) operator after member function name in php

这个问题在这里已经有了答案:Colonaftermethoddeclaration?(2个答案)关闭4年前。我想知道方法名称后冒号的含义,即publicfunctiongetTitle():Data{interfaceData{publicfunctiondetails(string$name);}classCompany{private$title;publicfunctiongetTitle():Data{return$this->title;}publicfunctionsetTitle(Data$title){$this->title=$title}}..........

php - Laravel: PHP Parse error: syntax error, unexpected '?' in/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php 第500行

自从我将我的php版本从5.6升级到7.2后,我的php_errors.log上一直存在错误:PHP解析错误:语法错误,意外的“?”在/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php第500行500号线:return$factory->of($arguments[0],$arguments[1])->times($arguments[2]??null);我在stackoverflow上搜索了一下,主要是服务器还在用php5.6,不过我觉得不是这个原因。平台是Laravel5.7,显然一切正常。如果我从终端运行