本文整理汇总了PHP中Assets::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::add方法的具体用法?PHP Assets::add怎么用?PHP Assets::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets
的用法示例。
在下文中一共展示了Assets::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before
function before()
{
parent::before();
if ($this->request->action() !== 'login') {
$this->check_access();
}
Assets::add('css', 'css/langify.css');
Assets::add('js', 'js/langify.js');
}
示例2: compose
public function compose($view)
{
\Assets::add(['admin', 'offcanvas', 'datepicker', 'responsive-tables']);
// Build menu tree for the top bar
$menu = new Node('menu', [self::buildTree()->addChild(AdminPanelMenuComposer::buildTree())]);
$rightmenu = new Node('rightmenu', [AdminPanelMenuComposer::buildSecondaryTree()]);
// Pass menu to the view
$view->with('menu', $menu->setRender(new FoundationTopBar())->purge())->with('rightmenu', $rightmenu->setRender(new FoundationTopBar())->purge());
}
示例3: compose
public function compose($view)
{
\Assets::add('admin');
// Build menu tree for the top bar
$menu = new Node('menu', [self::buildTree()->addChild(ReportsMenuComposer::buildTree())]);
$rightmenu = new Node('rightmenu', [self::buildSecondaryTree()]);
// Pass menu to the view
$view->with('menu', $menu->setRender(new FoundationTopBar())->purge())->with('rightmenu', $rightmenu->setRender(new FoundationTopBar())->purge());
}
示例4: compose
public function compose($view)
{
\Assets::add('master');
// Build sections that will be available in all views that use master layout.
if (auth()->check()) {
$sections[auth()->user()->getName()] = [link_to_route('admin', _('Dashboard')), link_to_route('logout', _('Logout')), link_to_route('contact', _('Contact'))];
} else {
$sections[_('Sections')] = [link_to_route('login', _('Login')), link_to_route('contact', _('Contact'))];
}
// Pass sections to the view
$view->with('sections', $sections);
}
示例5:
{{-- Live preview of Markdown --}}
<?php
Assets::add(['wiki.css', 'marked.js']);
?>
<fieldset>
<legend><label>{{ _('Preview') }}</label></legend>
<div id="preview">{!! $resource->markup !!}</div>
</fieldset>
@section('js')
@parent
<script>
$(document).ready(function() {
var $source = $("#source"), $preview = $("#preview");
$source.keyup(function () {
$preview.html(marked($(this).val()));
});
});
</script>
@stop
示例6:
<?php
Assets::add('canvas-demo.js');
?>
@section('main')
<canvas id="displayCanvas" width="1024" height="576"></canvas>
@stop
示例7:
@extends('layouts.base')
<?php
Assets::add(['admin', 'datatables']);
$labelClass = ['debug' => 'info', 'info' => 'info', 'notice' => 'info', 'warning' => 'warning', 'error' => 'alert', 'critical' => 'alert', 'alert' => 'alert'];
?>
@section('css')
<style>
table { width:100%; }
table tbody:hover > tr {/*opacity: 0.8; */}
table tbody:hover > tr:hover {
/*opacity: 1.0; */
background-color:#BBB !important;
}
pre {
font-size:80%;
padding:0 1em;
}
.row.fullWidth {
width: 100%;
margin-left: auto;
margin-right: auto;
max-width: initial;
margin-top:1em !important;
}
.side-nav .active { border-left: 2px solid #008CBA; }
.reveal-modal {margin:0 !important}
.no-wrap{
示例8: before
function before()
{
parent::before();
Assets::add('css', 'css/langify.css');
Assets::add('js', 'js/langify.js');
}
示例9:
@extends('layouts.master')
<?php
Assets::add('diff.css');
?>
@section('content')
<h3 class="text-center">{{ $subtitle }}</h3>
{{-- FACTS --}}
<div class="row">
<div class="small-6 columns">
<ul class="pricing-table">
<li class="title">{{ _('Before') }}</li>
<li class="price">{{ $before->name }}</li>
<li class="description">{{ _('Created by') }}: {{ $before->user }}</li>
<li class="bullet-item">{{ $before->created_at }} {{ $before->created_at->diffForHumans() }}</li>
<li class="cta-button"><a class="button" href="TODO">{{ _('Restore') }}</a></li>
</ul>
</div>
<div class="small-6 columns">
<ul class="pricing-table">
<li class="title">{{ _('After') }}</li>
<li class="price">{{ $after->name }}</li>
<li class="description">{{ _('Created by') }}: {{ $after->user }}</li>
<li class="bullet-item">{{ $after->created_at }} {{ $after->created_at->diffForHumans() }}</li>
<li class="cta-button"><a class="button" href="TODO">{{ _('Restore') }}</a></li>
</ul>
示例10: assetsAction
/**
* Minify assets (css & js) files
*/
public function assetsAction()
{
// Set the assets service
$assets = new Assets();
$assets->setOptions(['source' => __ROOT__ . '/public/', 'target' => 'min/', 'minify' => Assets::ALWAYS]);
foreach (['css', 'js'] as $type) {
$path = __ROOT__ . '/public/' . $type . '/';
foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
if (!$item->isDir() && $item->getExtension() == $type) {
echo $type . '/' . $iterator->getSubPathName() . "\n";
$assets->add($type . '/' . $iterator->getSubPathName());
}
}
}
}
示例11:
@extends('layouts.base')
<?php
Assets::add('admin');
?>
@section('body')
<div class="fixed contain-to-grid">@include('admin/top-bar')</div>
<div class="row">
<h1>{!! $title !!}</h1>
{!! $body !!}
</div>
@stop
示例12: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(FileEloquentRepository $file_repo, FolderEloquentRepository $folder_repo)
{
\Assets::add('vendor/filemanager/js/index.js');
return view('filemanager::index');
}
示例13:
<?php
Assets::add('wiki.css');
?>
{!! $resource->markup !!}
<p class="text-center">{!! link_to_route('page.version.index', _('View page versions'), [$resource->getKey()], ['class' => 'info tiny button']) !!}</p>
示例14: config
@extends('layouts.base')
<?php
Assets::add('master');
?>
@section('body')
<div class="row">
<div class="large-7 columns large-centered">
<h2 class="text-center">{{ config('site.name') }}</h2>
<div class="panel radius">
<div class="row collapse">
<div class="small-10 columns">
<h5>{{ _('Error') }} <span class="color">{{ $code }}</span></h5>
<h4>{{ $title }}</h4>
</div>
<div id="sad" class="small-2 columns text-center"><h1 class="color">:(</h1></div>
</div>
<hr/>
@section('problem-description')
<p>
{{ _("Something went wrong while we were processing your request") }}.
{{ _("We're really sorry about this, and will work hard to get this resolved as soon as possible") }}.
</p>
@show
<p>{!! sprintf(_('Perhaps you would like to go to our %shome page%s?'), '<a href="/">', '</a>') !!}</p>
示例15: markdown
<?php
Assets::add(['markdown.js']);
?>
{!!
Form::label($f = 'profiles', _('Profiles')),
checkboxes($f, App\Profile::dropdown(), $resource->profiles->pluck('id')->all())
!!}
@if($errors->has($f))<small class="error">{{ $errors->first($f) }}</small>@endif
{!!
Form::label($f = 'title', $labels->$f),
Form::text($f),
Form::label($f = 'body', $labels->$f),
Form::textarea($f)
!!}
{{-- Live preview of Markdown --}}
<fieldset id="preview">
<legend>{{ _('Preview') }} <a id="full">{{ _('Toggle full screen') }}</a></legend>
<h1 id="previewTitle">{!! $resource->title !!}</h1>
<div id="previewBody">{!! markdown($resource->body) !!}</div>
</fieldset>
@section('js')
@parent
<script>
$(document).ready(function() {