简体   繁体   中英

Render twig view on specific div

I'm using Twig with PHP, I wanted to know if it's possible to render a view on a specific div.

(with the url like this : localhost/home/#contact)

To render a view I'm doing this :

Controller :

public function show()
    {
        ...

        echo $twig->render('home.html.twig');
    }

index :

$router->get('/', 'Home#show');

我找到了一个解决方案,我不知道这是否是最好的方法,但它是:

header('Location: /home/#contact');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM