大家好,我是一个PHP
框架的新手codeIgniter
,我正在翻阅用户指南iv遇到了一个问题,我是在您加载帮助程序文件的那部分,但是由于某种原因,我的代码无法正常工作,但我不断收到此错误:
Fatal error: Call to undefined function anchor() in /home/fresherd/public_html/CI/system/application/views/blogview.php on line 17
Run Code Online (Sandbox Code Playgroud)
现在我不是100%确定它正在加载帮助程序文件,但这可能是导致的,但是我不确定如何检测文件是否已加载
任何建议都会帮助很多,艾伦
我曾尝试使用cakephp Debugkit工具栏cakephp 2.1.3
...但它不能正常工作..
我已经在cakephp 1.3
它上面实现了debugkit 工作正常..
我下载了debugkit for cakephp 2.1.3
.我重新检查了..
我是如何实现的?
app/plugin/DebugKit ///this is my path for debugkit
Run Code Online (Sandbox Code Playgroud)
我查了一下我的调试模式是2 ..
Configure::write('debug', 2);
Run Code Online (Sandbox Code Playgroud)
我如何在Appcontroller中加载我的调试工具包..'
public $components = array('DebugKit.Toolbar');
Run Code Online (Sandbox Code Playgroud)
它显示错误
Parse error: syntax error, unexpected T_FUNCTION in /var/www/guest1/cakephp-2.1.3/app/Plugin/debug_kit/Controller/Component/ToolbarComponent.php on line 165
Run Code Online (Sandbox Code Playgroud)
我从不同的源下载调试包但结果相同.
谢谢 !
它在此函数和行中显示错误
public function implementedEvents() {
$before = function ($name) {
return function () use ($name) {
DebugTimer::start($name, __d('debug_kit', $name));
};
};
$after = function ($name) {
return function () use ($name) {
DebugTimer::stop($name); …
Run Code Online (Sandbox Code Playgroud) 我正在使用MomentJS转换日期格式.
我有这个格式2010/12/01的日期,我想仅使用MomentJS将其转换为01/12/2010.
我有另一个日期,格式为"12/02/2014",我想转换为"2014/12/02"
<!--begin snippet: js hide: false console: true babel: false-->
<!--language: lang-js-->
var date = moment(new Date(2010/12/01)).format("MMM Do h/mm");
console.log(date);
<!--language: lang-html-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script>
<!--end snippet-->
Run Code Online (Sandbox Code Playgroud)
如何使用MomentJS转换它们
我像这样创建我的组件
<?php
class UtilComponent extends Object
{
function strip_and_clean( $id, $array) {
$id = intval($id);
if( $id < 0 || $id >= count($array) ) {
$id = 0;
}
return $id;
}
}
Run Code Online (Sandbox Code Playgroud)
并像这样使用它
var $name = 'Books';
var $uses = array();
var $components = array('Util');
public function index($id = 0){
$this -> set('page_heading','Packt Book Store');
$book=array(
'0'=>array(
'bookTitle' =>'Object Oriented Programming with PHP5',
'author' =>'Hasin Hayder',
'isbn' => '1847192564',
'releaseDate' => 'December 2007'
),
'1'=>array(
'bookTitle' =>'Building Websites with …
Run Code Online (Sandbox Code Playgroud) 我在我的代码中使用引导手风琴。单击每个列表,我将显示数据,图标将更改。
<i class="fa fa-plus-square"></i>
Run Code Online (Sandbox Code Playgroud)
将更改为
<i class="fa fa-minus-square"></i>
Run Code Online (Sandbox Code Playgroud)
我的代码:-
<div class="priority-lists">
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#waterMindDistrictMeteres">
<h2 class="panel-title accordion-toggle">
<i class="fa fa-minus-square"></i>
WaterMind District Meters
</h2>
</div>
<div id="waterMindDistrictMeteres" class="panel-collapse collapse">
<div class="panel-body">
<div class="row">
<div id="servicePointsGrid" watermind-priority-lists kendo-grid k-options="watermindDetailGridOptions" k-rebind="watermindDetailGridOptions"></div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#waterMindPressurePoints">
<h2 class="panel-title accordion-toggle">
<i class="fa fa-minus-square"></i>
WaterMind Pressure Points
</h2>
</div>
<div id="waterMindPressurePoints" class="panel-collapse collapse">
<div class="panel-body">
<div class="row">
<div id="servicePointsGrid" …
Run Code Online (Sandbox Code Playgroud) 我的组件代码 -
import { Component, EventEmitter, Input, OnInit, OnChanges, SimpleChanges, Output } from '@angular/core';
import { CI, CiWithStatus } from '../ci-list.service';
import { ContextPanelApi } from '../../../../../../../../shared/shared-html/js/directives/oprContextPanel/oprContextPanel/oprContextPanelApi.service';
@Component({
selector: 'opr-watchlist-cards',
templateUrl: './watchlist-cards.component.html',
styleUrls: ['./watchlist-cards.component.scss']
})
export class WatchlistCardsComponent implements OnInit, OnChanges {
@Input() ciList: CiWithStatus[];
@Input() itemWidth: number;
@Input() itemHeight: number;
@Input() zoomLevel: number;
@Output() onSelectedCisChanged: EventEmitter<CI[]> = new EventEmitter<CI[]>();
private _selectedItems: CI[] = [];
constructor(private _oprContextPanelApiService: ContextPanelApi) {
}
ngOnInit() {
console.debug('ciList', this.ciList);
}
ngOnChanges(changes: SimpleChanges): void {
if(changes.zoomLevel) …
Run Code Online (Sandbox Code Playgroud) 这是我的 json 数据 -
{
"list": [
{
"deviceId": "2a-d539-4031-9bfc-4a42f2f765cf",
"versions": [
{
"id": "764c20-a213-9235f4b553b3",
"createdTime": 1590361208034,
"files": [
{
"fileType": "VLAN"
},
{
"fileType": "STARTUPCONFIG",
}
],
"startupRunningStatus": "OUT_OF_SYNC",
"createdBy": "SCHEDULED"
},
{
"id": "9bd33-a45a-ed2fefc46931",
"createdTime": 1589972337717,
"files": [
{
"fileType": "VLAN",
},
{
"fileType": "STARTUPCONFIG",
},
{
"fileType": "RUNNINGCONFIG",
}
],
"startupRunningStatus": "IN_SYNC",
"createdBy": "SCHEDULED_FIRST_TIME"
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
我想过滤数据,其中“fileType”:“RUNNINGCONFIG”和“fileType”:“STARTUPCONFIG”存在于“文件”中,仅返回该数组。
例如,从上面的 json 中只会返回第二个对象。
我尝试编写一些过滤器代码,但它无法正常工作,请指导我。
let versionsData = response.data.versions;
versionsData = versionsData.filter(
versions => {
versions.files.filter(
m => …
Run Code Online (Sandbox Code Playgroud) javascript ×3
cakephp ×2
angular ×1
angular7 ×1
cakephp-2.0 ×1
cakephp-2.1 ×1
codeigniter ×1
components ×1
css ×1
html ×1
jquery ×1
momentjs ×1
php ×1
unit-testing ×1