如何在另一台计算机上访问我的本地wamp服务器
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
我在http.config文件中使用此代码但不起作用
根据Yii2 的官方教程.我为条目表单创建了一个视图:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
<?php $form = ActiveForm::begin(); ?>
<!-- GET Attention for the next Line -->
<?= $form->field($model, 'name')->label('Your Name'); ?>
<?= $form->field($model, 'email'); ?>
<div class="form-group">
<?= Html::submitButton('Send!', ['class' => 'btn btn-primary']); ?>
</div>
<?php ActiveForm::end(); ?>
Run Code Online (Sandbox Code Playgroud)
在这一点上一切都很好.但是,当我尝试使用options该field方法的参数时如下:
<?= $form->field($model, 'name', ['style' => 'color:red'])->label('Your Name'); ?>
Run Code Online (Sandbox Code Playgroud)
我有错误:
未知属性 - yii\base\UnknownPropertyException
设置未知属性:yii\widgets\ActiveField :: style
官方的api文档声明ActiveForm的方法采用了第三个名为options的参数
有人可以解释一下为什么会出现这个错误吗?!
我有以下正则表达式在Chrome中正常工作,但它在FireFox生成语法错误时不起作用Invalid Regex Group:
bld = txt.split(/(?<=:)/iu,1);
Run Code Online (Sandbox Code Playgroud)
我试图逃避:使用,/(?<=\:)/iu但它给出了同样的错误.我无法弄清楚这个问题的原因.
我想知道如何将单词转换为unicode,如下所示:http: //www.arabunic.free.fr/
考虑到阿拉伯语文本可能包含连字,谁能知道如何使用PHP?
谢谢
编辑
我不确定那个"unicode"是什么,但我需要在它的等效机器编号中使用阿拉伯字符,因为阿拉伯字符根据其位置具有不同的上下文形式 - 请参见此处:
http://en.wikipedia.org/wiki/Arabic_alphabet#Table_of_basic_letters
不同位置的相同角色:
ب| ب| ب| ب
我认为它必须是将每个阿拉伯字符转换成它的等价数字的方法,但是如何?
编辑
我仍然相信有一种方法可以根据位置将每个角色转换为它的形式
任何想法都表示赞赏..
为简化起见,我有两个表使用外键与一对多相关,例如:
Users table:
id
name
Actions table:
id
user_id
Run Code Online (Sandbox Code Playgroud)
一个用户可能有很多动作.我需要一个sql select来返回在actions表中没有user_id值的用户id.
Users Table:
id name
1 John
2 Smith
3 Alice
Actions Table:
id user_id
1 3
2 1
Run Code Online (Sandbox Code Playgroud)
所以我需要一个返回用户ID 2(Smith)的SQL查询,因为外键值不包含id 2
我尝试了以下SQL,但它返回所有用户ID:
SELECT users.id from users left join actions on actions.user_id is null
Run Code Online (Sandbox Code Playgroud) 我想我的版本1.2到1.3的angular-animate.js存在迁移问题.这是我的动画
'use strict';
angular.module('cookbook', ['ngAnimate'])
.animation('.slide-down', function() {
var NG_HIDE_CLASS = 'ng-hide';
return {
beforeAddClass: function(element, className, done) {
alert('before add');
if(className === NG_HIDE_CLASS) {
element.slideUp(done);
}
},
removeClass: function(element, className, done) {
if(className === NG_HIDE_CLASS) {
element.hide().slideDown(done);
}
}
};
});
Run Code Online (Sandbox Code Playgroud)
同步测试
'use strict';
describe('A Brief Look At Testing Animations(changed) - ', function() {
var scope;
var element;
var $animate;
var $rootElement;
beforeEach(module('cookbook', 'ngAnimateMock'));
describe('Synchronous testing of animations', function() {
var animatedShow = false;
var animatedHide = false;
beforeEach(module(function($animateProvider) …Run Code Online (Sandbox Code Playgroud) 从这里:
"在React之外获取React Component实例句柄的唯一方法是存储React.render的返回值."
我需要在React之外渲染一个React组件,我将在下面提到它的原因.
在我的node.js,expressJS应用程序中,我使用'react-router-component'和'react-async'.
在app.js中 - 应该运行的文件,
var url=require('url');
var App=require('./react/App.jsx');
var app = express();
app.get('*',function(req,res){
//}); SEE EDIT 1 BELOW
var path = url.parse(req.url).pathname;
ReactAsync.renderComponentToStringWithAsyncState(App({path:path}),function(err, markup) {
res.send('<!DOCTYPE html>'+markup);
});
});
Run Code Online (Sandbox Code Playgroud)
在App.jsx中,
PostList = require('./components/PostList.jsx');
var App = React.createClass({
render: function() {
return (
<html>
<head lang="en">
</head>
<body>
<div id="main">
<Locations path={this.props.path}>
<Location path="/" handler={PostList} />
<Location path="/admin" handler={Admin} />
</Locations>
<script type="text/javascript" src="/scripts/react/bundle.js"></script>
<script type="text/javascript" src="/scripts/custom.js"></script>
</body>
</html>
});
Run Code Online (Sandbox Code Playgroud)
bundle.js …
我在当前的yii2项目中创建了一个简单的小部件.简单地说,它为所有jui主题创建一个选择选项列表,并允许用户更改主题并将其保存为cookie的意思.
这个小部件需要两个javascript文件, - 它们在run()中注册 - 其中一个是jquery cookies插件.我问的是如何保存这个小部件及其js文件的完整性,以便在其他Yii2项目中轻松重用,而不需要复制所有需要的js文件?
<?php
namespace common\libs;
use yii;
use yii\base\Widget;
use yii\web\View;
use yii\web\JqueryAsset;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of JuiThemeSelectWidget
*
* @author Said Bakr
*/
class JuiThemeSelectWidget extends Widget
{
private $list;
private $script;
private static $juiThemeSelectId = 'JuiThemesList';
public …Run Code Online (Sandbox Code Playgroud) 我想使用PHP实现图的下一个片段.
请参阅下面的组成示例图:
我们可以使用内部类在Java中实现组合.
但PHP中没有"内部类"的类比.当然,还有一些特点.但是我们可以在多个班级中使用它.
我已经实现了这样的组合:
class Head {
private static $instance = NULL;
private function __construct(){}
public static function getInstance() {
$traces = debug_backtrace();
if (strcmp($traces[1]['class'], 'Human')) {
echo "<br>Only human has head"; // Exception can be thrown here
return NULL;
}
if (!static::$instance) static::$instance = new self();
return static::$instance;
}
public function __toString() {
return 'Head';
}
}
class Human {
private $head;
public function __construct() {
$this->head = Head::getInstance();
}
public function __toString() {
return 'I …Run Code Online (Sandbox Code Playgroud) 现在的问题是:不GitHub的页面支持AngularJS html5mode?
我找到了一个www资源,声明可以通过404后备页面来实现.好吧,这似乎是一个错误的解决方案,因为每次调用都会返回404错误.这肯定不会是seo友好的.html5mode应该需要服务器端支持(为每次调用返回html入口点).
那么 - 是否有可能以正确的方式在GitHub页面上提供AngularJS html5mode ?
php ×5
javascript ×3
angularjs ×2
yii2 ×2
apache ×1
ar-php ×1
composition ×1
database ×1
express ×1
firefox ×1
github-pages ×1
html ×1
html5 ×1
http ×1
jasmine ×1
mysql ×1
node.js ×1
one-to-many ×1
oop ×1
react-async ×1
react-jsx ×1
reactjs ×1
regex ×1
sql ×1
tdd ×1
unicode ×1
wamp ×1
widget ×1