motionmindz Posted December 12, 2013 Share Posted December 12, 2013 I dont see a good way to check/inspect if my Jquery libs are correctly linked as are my CSS sheets. I want to debug step by step the PHP code. But how to organize this most efficiently ? I am a newbie I know... Link to comment Share on other sites More sharing options...
Martijn Geerts Posted December 12, 2013 Share Posted December 12, 2013 1. I dont see a good way to check/inspect if my Jquery libs are correctly linked as are my CSS sheets. In Chrome, click 'inspect' element, then click the network tab inside the inspector, there you can see what is loaded.2. I want to debug step by step the PHP code. In your config.php put: $config->debug = true; // Under no circumstance should you leave this ON with a live site. echo out, var_dump variables, to see if they have the expected outcome. 3. Read or watch movies about PHP. 4. Be eager ! 3 Link to comment Share on other sites More sharing options...
pwired Posted December 12, 2013 Share Posted December 12, 2013 First build up more routine with using html, css and especially the api inside processwire, then start with php 5. go through the processwire website tutorials 6. follow the examples you find included on many free picture galleries. 7. With google and this forum you can find many code snippets and try them out in processwire. Have a look here too: http://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/ Link to comment Share on other sites More sharing options...
alan Posted December 12, 2013 Share Posted December 12, 2013 +1 re the other suggestions, especially config->debug. Check the bottom of this page where it says Maintaining a separate development configuration file You may optionally maintain a separate development configuration file at /site/config-dev.php. When present, ProcessWire will use this file rather than /site/config.php. This may be useful on your development and/or staging server and allows you to maintain the same /site/config.php file between staging and production server. As an example, your /site/config-dev.php file may have the database connection information specific to your development server, while your /site/config.php has the database connection information specific to your production server. This prevents the possibility of overwriting your production server's configuration file during migrations and mirrors. Of course, you will want to ensure that your config-dev.php file does not end up on your production server by adding it to the file exclusion list of whatever tool you are using to transfer files. The advantage of this is that you can have your local setup verbose about errors and your live site not verbose (by setting the config->debug differently in the two files). If you are very new then you may want to come back to look at this later since it's just a nicety (but a very nicety I think ) Another good thing that is sometimes appropriate is to build and test the HTML+CSS+jQ first (ignoring any PW) then gradually introduce PW so for example have PW replace a static TITLE tag with data generated from PW. 1 Link to comment Share on other sites More sharing options...
motionmindz Posted December 16, 2013 Author Share Posted December 16, 2013 Thanks a lot! I have found the Inspector in Nightly also to help. And the config-dev php file is a very good way of testing out stuff. Cheers ! One question though: does PW indicate in some way you are working with a config-dev file and therefore working in a test environment with test config settings ? 1 Link to comment Share on other sites More sharing options...
alan Posted December 16, 2013 Share Posted December 16, 2013 One question though: does PW indicate in some way you are working with a config-dev file and therefore working in a test environment with test config settings ? I don't think it does(?). But you could easily do this yourself. For example create a variable (for consistency declare it in config.php as well as config-dev.php) and test for it. So config.php: $config->showConfigDevPresent = 'no'; and config-dev.php: $config->showConfigDevPresent = 'yes'; Then in your code, for example at the top of every page, check to see if this var is true and if so then have a styled alerting top row (or similar visual cue) to highlight this site is running with config-dev.php present. In fact I think I'll do that from now on! Thanks for asking the question! 1 Link to comment Share on other sites More sharing options...
motionmindz Posted December 16, 2013 Author Share Posted December 16, 2013 This would be great to have in PW automatically as some flag indicator. 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