小编Tho*_*ord的帖子

指南针在Symfony 2资产过滤器异常中

我已经在我的symfony 2项目中安装了指南针.现在我想将资产过滤器与指南针结合使用.我正在使用Windows 7.

我认为它几乎正常,但我仍然收到此错误:

[Assetic\Exception\FilterException]
An error occurred while running:
"C:\Ruby21-x64\bin\ruby.EXE" "C:\Ruby21-x64\bin\compass.BAT" "compile" "C:\
Users\tommie\AppData\Local\Temp" "--boring" "--config" "C:\Users\tommie\App
Data\Local\Temp\ass4325.tmp" "--sass-dir" "" "--css-dir" "" "C:/Users/tommi
e/AppData/Local/Temp/ass4326.tmp.scss"
Error Output:
C:/Ruby21-x64/bin/compass.BAT:1: syntax error, unexpected tCONSTANT, expect
ing end-of-input
Run Code Online (Sandbox Code Playgroud)

我在html(twig)中的代码:stylesheets.html.twig

{% stylesheets filter="compass" output='css/compiled/*.css'
   "@AcmeSassDemoBundle/Resources/assets/css/base.scss"
%}
<link rel="stylesheet" href="{{ asset_url }}" />

{% endstylesheets %}
Run Code Online (Sandbox Code Playgroud)

base.html.twig:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{% block title %}Sass Demo!{% endblock %}</title>
    {#{% block stylesheets %}{% endblock %} #}

    {% include "AcmeSassDemoBundle:Demo:stylesheets.html.twig" %}
    <link …
Run Code Online (Sandbox Code Playgroud)

php ruby symfony compass

38
推荐指数
1
解决办法
1271
查看次数

Symfony 2:强制所有路由的https

我在symfony 2框架中创建了一个Web应用程序.这工作正常,但现在我想将所有路由的http://更改为https://!

如何在此查看我的环境是否为localhost.如果我在本地工作,我想使用正常的http://.

在哪里设置这个,我找不到它?

谢谢!

php http symfony

10
推荐指数
1
解决办法
1万
查看次数

从jQuery加载symfony 2目录中的php文件

我在一个包内的twig文件中有这行代码(jQuery)(BundleDir/Bundle/views/mapname/index.html.twig):

$('#datacount').load('getDataCount.php');
Run Code Online (Sandbox Code Playgroud)

我的问题是我需要将getDataCount.php文件放在symfony 2目录中.它一直说这个文件找不到..

谢谢 !

ajax jquery symfony

4
推荐指数
1
解决办法
565
查看次数

JS中的动态变量

我有这个代码:

var dynamicVarName = id;

var percentage = res.parkeren[0].dynamicVarName.percentage;
Run Code Online (Sandbox Code Playgroud)

DynamicvarName可以有不同的值,但是当我在var百分比中调用它时它不起作用.

如何在数组/对象中获取动态变量?

javascript arrays

2
推荐指数
1
解决办法
52
查看次数

Symfony2中的Sass/Compass

我尝试使用symfony2和asseticbundle的scss文件.

我的config.yml资产部分:

assetic:
debug:          %kernel.debug%
use_controller: false
bundles:        []
filters:
    sass:    ~
    compass: ~
    #closure:
    #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
    #yui_css:
    #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
Run Code Online (Sandbox Code Playgroud)

我的base.html.twig:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>{% block title %}Welcome!{% endblock %}</title>
    {% block stylesheets %}
        {% stylesheets filters="compass"
            "@TestBundle/Resources/public/sass/main.scss"
        %}
        <link rel="stylesheet" href="{{ asset_url }}" />
        {% endstylesheets %}
    {% endblock %}

    <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body ng-app="myapp">
{% block body %}{% endblock %}
{% block javascripts %}
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
    <script …
Run Code Online (Sandbox Code Playgroud)

css sass symfony

1
推荐指数
1
解决办法
1057
查看次数

Symfony 2 Angular JS HTTP POST

我有一个表单,我使用angularJS http方法提交.

代码:

<script>
    // define angular module/app
    var formApp = angular.module('formApp', []);
    // create angular controller and pass in $scope and $http
    function formController($scope, $http) {
        // create a blank object to hold our form information
        // $scope will allow this to pass between controller and view
        $scope.formData = {};
        // process the form
        $scope.processForm = function () {
            $http({
                method: 'POST',
                url: 'http://localhost/angular/web/app_dev.php/testcall',
                data: $.param($scope.formData), // pass in data as strings
                headers: {'Content-Type': 'application/x-www-form-urlencoded'}  // set the headers …
Run Code Online (Sandbox Code Playgroud)

symfony angularjs

0
推荐指数
1
解决办法
1846
查看次数

JavaScript中的-1小时时间戳

我有以下时间戳记:1445086800

我想做-这个时间戳记1小时。用javascript执行此操作的最佳方法是什么?输出也必须是unix时间戳。

javascript函数中是否有类似strtotime()的东西?

谢谢。

javascript date

0
推荐指数
1
解决办法
6267
查看次数

标签 统计

symfony ×5

javascript ×2

php ×2

ajax ×1

angularjs ×1

arrays ×1

compass ×1

css ×1

date ×1

http ×1

jquery ×1

ruby ×1

sass ×1