Mats Posted November 28, 2022 Share Posted November 28, 2022 Hi @teppo! I' trying to check what view file the user is on but the getView method returns null. I'm using it like this in the controller (tried both in the render and init method): if($this->wire('page')->name == "kopa-bil"){ $this->view->setView('buy'); } And $page->getView() in the view-file which returns null. Link to comment Share on other sites More sharing options...
teppo Posted November 28, 2022 Share Posted November 28, 2022 Hey @Mats, In this case you're setting view directly on the View object, so you should read it from there as well: // in controller $this->view->setView('buy'); // in view file echo $this->getView(); 1 Link to comment Share on other sites More sharing options...
Mats Posted November 28, 2022 Author Share Posted November 28, 2022 Thanks @teppo! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now