我对 laravel4 很陌生,但有一些 codeigniter 背景。我尝试弄清楚如何将 url 路由到控制器方法
我的网址应该是这样的
/admin/products{controller_name}/parser{controller_method}
Run Code Online (Sandbox Code Playgroud)
比控制器
<?php namespace App\Controllers\Admin;
use App\Models\Product;
use Image, Input, Notification, Redirect, Sentry, Str;
class ProductsController extends \BaseController {
public function index()
{
return \View::make('admin.products.index');
}
public function parser()
{
return \View::make('admin.products.parser');
}
}
Route::group(array('prefix' => 'admin', 'before' => 'auth.admin'), function()
{
Route::resource('products', 'App\Controllers\Admin\ProductsController');
Route::resource('products/parser', 'App\Controllers\Admin\ProductsController@parser');
});
Run Code Online (Sandbox Code Playgroud) 我刚开始探索反应,并试图了解如何使用react-bootstrap如果安装在bower上我只是按照入门部分但我真的不明白应该如何工作.
我有我的标记
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="styles/main.css" rel="stylesheet">
<script src="vendor/react/react.js"></script>
<script src="vendor/react-bootstrap/react-bootstrap.js"></script>
<script src="vendor/react/JSXTransformer.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page …Run Code Online (Sandbox Code Playgroud) 拥有以下React路由器
const AppRoutes = (
<Route path="/" handler={Properties}>
<DefaultRoute handler={PropertyList} />
<Route path="property/:propId" handler={PropertyDetail}/>
<NotFoundRoute handler={NotFound} />
</Route>);
Router.run(AppRoutes, Router.HashLocation, (Root) => {
React.render(<Root />, document.getElementById('filter-content'));
});
Run Code Online (Sandbox Code Playgroud)
我尝试在子Component中构建动态链接,在这里我有一个测试
<Link to="/property/" params={{ propId: "123"}} ><img src={this.props.data.picture}
data-srcset="http://placehold.it/350x150" alt="" className="lazyload auto-height"
data-sizes="auto"/>
</Link>
Run Code Online (Sandbox Code Playgroud)
但点击propId没有通过的链接,我做错了什么?
我想使用类名向最后一个 ul 元素添加不同的样式footer_list,但以下内容均不起作用
ul.footer_list:last-child {
border-right: none;
}
#menu-bottom.pads ul.footer_list:last-child {
border-right: none;
}
Run Code Online (Sandbox Code Playgroud)
结构如下所示
<div class="pads clearfix" id="menu-bottom">
<ul class="footer_list">
<li><a title="" href=""></a></li>
</ul>
<ul class="footer_list">
<li><a title="Zu den Dell Gutschein Codes" href="/dell-gutschein-codes/"></a></li>
</ul>
<ul class="footer_list">
<div class="menu-footer-container">
<ul class="menu" id="menu-footer">
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-25" id="menu-item-25"><a href=""></a></li>
</ul>
</div>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud) 使用LexikJWTAuthenticationBundle,FOSRest,FOSUser如何通过令牌获取经过身份验证的用户配置文件.可能吗?
所以,假设用户已经通过LexikJWT进行了身份验证,并且我有一个api端点,就像/api/profile我发送令牌一样,我希望得到指定的用户数据.
我正在使用Redux的前端ReactJS.
我正在尝试在ajax帖子上设置一个令牌,但是没有得到控制器方法的识别.javascrip看起来如下
jQuery(document).ready(function() {
jQuery('#source').change(function() {
jQuery('#fileupload').addClass('fileupload-processing');
var data = jQuery('#source option:selected').val();
jQuery.post('index.php', {
'option': 'com_tieraerzte',
'task': 'parser.importColumns',
'tmpl': 'component',
'token':'<?php echo JUtility::getToken()?>',
'app': data,
'dataType': 'html',
}, function(result) {
jQuery('td.add_column').html(result);
jQuery('button#parse.btn').show();
//edit the result here
return;
});
});
Run Code Online (Sandbox Code Playgroud)
令牌生成并发布
在控制器中,我检查toke的存在,但抛出无效令牌
控制器检查toke
JRequest::checkToken('request') or jexit( 'Invalid Token' );
Run Code Online (Sandbox Code Playgroud) 如何在Joomla 3.1中使用Bootstrap模式?我加载了Bootstrap,当我尝试初始化时
$('#confirmDelete').modal();
Run Code Online (Sandbox Code Playgroud)
我得到的模态窗口 $(...).modal is not a function
如果我想在彼此旁边显示网格,我该如何制作脚手架.我的实际代码
<div class="span8">
<div class="row-fluid">
<?php foreach($items as $item) : ?>
<div class="span6">
<?= $item ?>
</div>
<?php endforeach; ?>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
网格显示出来
-------------------
1box 2box
-------------------
3box
-------------------
4box
-------------------
5box
-------------------
Run Code Online (Sandbox Code Playgroud)
我想表明
-------------------
1box 2box
-------------------
3box 4box
-------------------
5box
-------------------
Run Code Online (Sandbox Code Playgroud) 我尝试在我的自定义wordpress插件中使用bootstrap,但似乎打破了所有管理区域以下
class MyPlugin{
public function iniAdmin(){
add_action('admin_menu', array($this, 'register_collections_menu_page'));
add_action( 'admin_init', array($this,'style_bootstrap' ));
}
public function style_bootstrap(){
wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', array('jquery'), '1.9.1', true); // we need the jquery library for bootsrap js to function
wp_enqueue_script( 'bootstrap-js', '//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js', array('jquery'), true); // all the bootstrap javascript goodness
wp_enqueue_style( 'bootstrap', '//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css' );
}
}
$collections_settings = new MyPlugin();
if (is_admin()){
$collections_settings->iniAdmin();
}
Run Code Online (Sandbox Code Playgroud)
如何在wordpress插件中以propper方式包装bootstrap样式
如何使用 Carbon 获取过去 30 天的数组。我试图生成一个日期数组来与日期上的数据库结果进行比较,以填补记录没有值的空白
我有这个片段,它或多或少地返回所需的结果,但我想知道是否有更好的方法
$start = Carbon::now()->subDays(30);
for ($i = 0 ; $i < 30 ; $i++) {
$dates[] = $start->copy();
$start->addDay();
}
dd($dates);
Run Code Online (Sandbox Code Playgroud) 如何在laravel雄辩的对象中选择字段
User::select('username', 'firstname', 'lastname')->with(['periods' => function($){
$->select('jobtitle')->orderBy('start_date', 'desc')->limit(1);
}])->paginate(50);
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我可能得到句点为空
php ×3
css ×2
laravel ×2
reactjs ×2
ajax ×1
arrays ×1
children ×1
eloquent ×1
emit ×1
html ×1
joomla ×1
joomla3.1 ×1
laravel-4 ×1
laravel-5 ×1
modal-dialog ×1
params ×1
parent ×1
php-carbon ×1
plugins ×1
profile ×1
react-router ×1
relationship ×1
scaffolding ×1
subquery ×1
symfony ×1
token ×1
vue.js ×1
wordpress ×1