seedle Posted September 21, 2014 Posted September 21, 2014 hi, I've installed processwire 2.4 as suggested and trying to learn. Implemented Simple new system from github. I just need to understand what wire("page")/wire("pages") do. Thanks!
adrian Posted September 21, 2014 Posted September 21, 2014 Hi seedle, Firstly, 2.5 is the current stable version so you should grab that instead. As for page/pages: http://processwire.com/api/variables/page/ http://processwire.com/api/variables/pages/ I am not really sure what information you need, but to clarify, wire('page') is effectively the same as $page, but due to PHP variable scope $page is not available inside your own functions, inside PW modules, or on a script that is bootstrapped to PW. That is when you need to use wire('page'). Same goes for all the PW variables: wire('input'), wire('sanitizer'), wire('user') etc. If you are wondering what $page and $pages are actually for. Basically, $page gives you access to all the fields on the currently viewed page on your site, eg: $page->body $pages gives you access to all pages on your site - you can query the pages you want using selectors, which are Processwire's version of database queries. It sounds like you might benefit from reading through some of the new tutorials: http://processwire.com/docs/tutorials/ and of course the cheatsheet: http://cheatsheet.processwire.com/ Hope that helps! 8
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