Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:39:16+00:00 2026-06-05T22:39:16+00:00

I use Silex Frame Work and I am trying to delete files in backend

  • 0

I use Silex Frame Work and I am trying to delete files in backend that listed in a table using the following code but fire bug is given me an error message “invalid regular expression flag a” And when i click on the DELETE link it goes to a white page.The code is:

<script type="text/javascript">
    $(document).ready(function(){
        $(".delete-file").live('click', function() {
            itemRow   = $(this).parent().parent().parent();
            fileId    = $(this).attr('file_id');
            deleteURL = $(this).attr('href');

            var html   = "<div> Are you sure, you want to DELETE this file? </div>";
            var dialog = $(html).dialog({
                buttons: {
                    "Ok": function() {
                        $.ajax({
                            url     : deleteURL,
                            type    : 'DELETE',
                            success : function(data) {
                                itemRow.remove();
                                dialog.dialog("close");
                            },
                            error   : function() {
                                dialog.dialog("close");
                            }
                        });
                    },
                    "Cancel": function() {
                        $(this).dialog("close");
                    }
                }
            });
            return false;
        });
    });
</script>

and i use:

   {% for row in result %}
       <tr class="content {{ cycle(['odd', 'even'], loop.index) }}">
            <td> {{ row.name }} </td>
            <td> {{ row.user.username }} </td>
            <td class="url"> <a href="{{ path('info', {"id" : row.file_id}) }}">{{ row.path | truncate(30) }}</a> </td>
            <td> <img src="{{conf('base_url')}}/{{row.thumbnail}}"/> </td>
            <td class="url"> {{ row.size | bytes_format}} </td>
            <td> {{ row.description }} </td>
            <td>
                <span><a href="{{ path('delete', {'id' : row.file_id} ) }}" class="delete-file" file-id="{{row.file_id}}">DELETE</a></span>
            </td>
        </tr>
   {% endfor %}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:39:18+00:00Added an answer on June 5, 2026 at 10:39 pm

    I found it. it’s just because of giving wrong path to my .js files!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to try Silex but i've some questions. I know to use
Use case: I find a piece of code that I do not understand at
I'm trying to run application with Silex FW . I have similar source code
use Text::Table; my $tb = Text::Table->new(Planet,Radius\nkm,Density\ng/cm^3); $tb->load( [ Mercury,2360,3.7], [ Mercury,2360,3.7], [ Mercury,2360,3.7], );
My question: How do I permit use of debug in Twig templates within Silex?
My application file: <?php // /src/app.php require_once __DIR__ . '/../lib/vendor/Sensio/silex.phar'; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response;
I'm writing code that uses a large matrix where the elements are a user
I'd like to use Silex's service providers just to build a simple contact form
I am wanting to use the Symfony\Component\Process\ProcessBuilder class and can see that it is
I'm attempting to do something using Silex (which uses the Symfony routing component -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.