Giter Club home page Giter Club logo

Comments (7)

zamronypj avatar zamronypj commented on May 23, 2024 4

path_for is removed in commit 71d9bb9cc68. Replace with url_for() or full_url_for().

from twig-view.

geggleto avatar geggleto commented on May 23, 2024 1

doesn't look like you are adding the extension properly.

from twig-view.

1f7 avatar 1f7 commented on May 23, 2024

path_for('home') work with named routes with setName
f.ex.
$app->get('/', 'App\Controllers\Home:index')->setName('home');

from twig-view.

geggleto avatar geggleto commented on May 23, 2024

answered.

from twig-view.

Cvar1984 avatar Cvar1984 commented on May 23, 2024

path_for('home') work with named routes with setName
f.ex.
$app->get('/', 'App\Controllers\Home:index')->setName('home');

Im on slim4 is ->setName method from routing got removed? path_for is also not working for me
this is my route

$app->any('/home', \App\Controller\HomeController::class)->setName('home');
{{ path_for('home') }}

from twig-view.

l0gicgate avatar l0gicgate commented on May 23, 2024

Im on slim4 is ->setName method from routing got removed?

@Cvar1984 no, it's still here:
https://github.com/slimphp/Slim/blob/4.x/Slim/Interfaces/RouteInterface.php#L85

path_for is also not working for me

The functionality has moved to the RouteContext object:
http://www.slimframework.com/docs/v4/objects/request.html#obtain-base-path-from-within-route

from twig-view.

Cvar1984 avatar Cvar1984 commented on May 23, 2024

Im on slim4 is ->setName method from routing got removed?

@Cvar1984 no, it's still here:
https://github.com/slimphp/Slim/blob/4.x/Slim/Interfaces/RouteInterface.php#L85

path_for is also not working for me

The functionality has moved to the RouteContext object:
http://www.slimframework.com/docs/v4/objects/request.html#obtain-base-path-from-within-route

I got string(0) "" from

$view = \Slim\Views\Twig::fromRequest($request);
$basePath = \Slim\Routing\RouteContext::fromRequest($request)->getBasePath();

I want to get absolute url for loading assets, i have try using twig-assets too, but it wont't load an images

from twig-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.