Cakephp 3创建一个带标签的无线电容器 - >输入就像那样
<div class="radio">
<label class="radio-acces-checked" for="condition-access-1">
<input id="condition-access-1" type="radio" value="1" name="condition_access">
Free access
</label>
</div>
...
Run Code Online (Sandbox Code Playgroud)
我想改变结构,但它不起作用,它始终是相同的结构...你有一个关于如何解决我的问题的想法?
$myTemplates = [
'radioWrapper' => '<div class="radio">{{label}}{{input}}</div>'
];
echo $this->Form->radio('condition_access', [
['value' => 1, 'text' => __('Free Access')],
['value' => 2, 'text' => __('Payment Access')],
['value' => 3, 'text' => __('Reduce price')]
]);
Run Code Online (Sandbox Code Playgroud) 我试图用很多"跨度"替换div的每个字母.
除了带有"é"等重音的字母外,此代码有效.你能帮我吗?
$('h2').each(function(){
$(this).html($(this).text().replace(/(\w)/g, "<span>$&</span>"));
});
Run Code Online (Sandbox Code Playgroud) 我是Symfony 2的初学者.
我正在尝试显示带有"选择"的表单,其中是查询中的"选项".
我把以下代码放在我的表单中:
use Doctrine\ORM\EntityRepository;
use Bloc\MainBundle\Entity\Table;
use Bloc\MainBundle\Entity\Table2;
public function addAction(Request $request)
{
$table = new Table();
$form = $this->createFormBuilder($table , array('attr' => array('role' => 'form')))
->add('num', 'integer', array('label' => 'Numéro', 'attr' => array('class' => 'form-control')))
->add('nom_emetteur', 'text', array('label' => 'Emetteur', 'attr' => array('class' => 'form-control')))
->add('numero', 'entity', array('class' => 'BlocMainBundle:Table2', 'property' => 'numero'))
...
}
Run Code Online (Sandbox Code Playgroud)
我有以下错误:
Neither the property "numero" nor one of the methods "getNumero()", "isNumero()", "hasNumero()", "__get()" or "__call()" exist and have public access in …
Run Code Online (Sandbox Code Playgroud) 我想在我的主题中做一个ajax请求.
如果我登录后台,请求会,但如果我没有登录,则返回为空...请问有什么解决方案?
在我看来 :
$.ajax({
type: "POST",
url: 'http://www.mysite.com/wp-admin/admin-ajax.php',
data: $('#EventForm').serialize()+'&action=event_form',
success: function(response){
if(response == 1){
alert('ok');
} else {
alert('no ok');
}
});
Run Code Online (Sandbox Code Playgroud)
在functions.php中(仅当我登录后台办公时才有效)
add_action('wp_ajax_event_form', 'ajax_event_form');
function ajax_event_form(){
global $wpdb;
...
echo true;
die;
}
Run Code Online (Sandbox Code Playgroud) ajax ×1
cakephp ×1
cakephp-3.1 ×1
doctrine-orm ×1
forms ×1
helper ×1
javascript ×1
jquery ×1
radio ×1
regex ×1
symfony ×1
wordpress ×1