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 9189777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:18:40+00:00 2026-06-17T20:18:40+00:00

I couldn’t find it anywhere. So I ask: On silex, why do we use

  • 0

I couldn’t find it anywhere. So I ask: On silex, why do we use bind() for? For example, on this routing of static pages:

$pages = array(
    '/'      => 'index',
    '/blog'  => 'blog',
    '/about' => 'about',
);

foreach($pages as $route => $view) {
    $api->get($route, function(Silex\Application $app) use($view) {
        return $app['twig']->render($view.'.html');
    })->bind($view);
}
  • 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-17T20:18:41+00:00Added an answer on June 17, 2026 at 8:18 pm

    For an event-heavy framework, it’s a bit of a poor choice, but this basically names the route.

    Things like providers can get access to the routes if they are given a name.

    Relevant documentation:

    • http://silex.sensiolabs.org/doc/usage.html#named-routes
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I couldn't find anything similar to this anywhere. I have an array of pointers
Couldn't find an answer to this anywhere, but essentially I am wanting to add
Couldn't find a better place to ask this so I hope you guys can
Couldn't find this anywhere, maybe I'm looking for the wrong verbs. I'm trying to
Couldn't find a function for this. I'm assuming I need to use regex? I'm
Couldn't find this on stackoverflow and I did have an example of it which
Couldn't find anything about this on the internet, or stackoverflow?!? Basic Example: A great
Couldn't find similar enough question so I'll ask. I'm trying to use facebook log-in
I couldn't find any definitive answer to this question. I suppose most implementation use
I couldn't find this in the documentation. If I have a complex object in

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.