# Modern web development - a tutorial series

**URL:** <https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602>\
**Category:** General Chat\
**Created:** [November 2, 2014, 8:59am UTC](https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602 "2014-11-02T08:59:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JimL](https://www.phphelp.com/user_avatar/www.phphelp.com/jiml/32/1842_2.png) [@JimL](https://www.phphelp.com/u/JimL)\
**Post date:** [November 2, 2014, 8:59am UTC](https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602/1 "2014-11-02T08:59:05Z")

</div>

I have been considering writing up a tutorial series on modern web development.

[ul][li]using vagrant as a simple way to get a “real” server environment in a virtual machine[/li]  
[li]setting up vhosts (domains) on the server[/li]  
[li]installing and using xdebug - no more print\_r/var\_dump![/li]  
[li]installing and using composer - package manager with auto loading of libraries - no more include/require![/li]  
[li]using Doctrine2 ORM to work with a database - auto generate/edit tables[/li]  
[li]building a simple api that output json[/li]  
[li]Angular JS - front end![/li]  
[li]SASS - stylesheets (css) with functions, variables, loops, nesting, etc[/li]  
[li]Gulp - build tool that automates tasks (concat files, minify, etc)[/li]  
[li]Tying together frontend and backend[/li][/ul]

Anything of this that sound interesting?

---

<div class="post-metadata">

**Author:** ![benanamen](https://www.phphelp.com/user_avatar/www.phphelp.com/benanamen/32/287_2.png) [@benanamen](https://www.phphelp.com/u/benanamen)\
**Post date:** [November 2, 2014, 5:41pm UTC](https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602/2 "2014-11-02T17:41:09Z")

</div>

It all sounds good to me, but I think those subjects are too advanced for most users of this forum. On another note, the old tutorials on this forum need to be replaced with something current.

---

<div class="post-metadata">

**Author:** ![JimL](https://www.phphelp.com/user_avatar/www.phphelp.com/jiml/32/1842_2.png) [@JimL](https://www.phphelp.com/u/JimL)\
**Post date:** [November 2, 2014, 7:02pm UTC](https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602/3 "2014-11-02T19:02:26Z")

</div>

Sure, they are not directly “beginning php” style tutorials, but we need tutorials for “step 2” as well, after you’ve learned about variables, functions and other basics.

Using vagrant is actually easier/better than xampp/wampp/whatever.  
Using xdebug could make it much more clear where your errors are as you can step through the entire application line by line.  
Composer, makes it easier as you can just include whatever library you want and it’s auto loaded and available.  
Doctrine should probably not be used if you don’t know the sql under it, but after setting it up (which you do only once) then it’s very easy to use, it even auto generates the db schema for you.  
Angular, just an intro, doesn’t have to be that advanced 🙂  
SASS - not advanced  
Gulp - not advanced  
Tying together frontend and backend - not advanced 🙂

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [November 4, 2014, 10:14pm UTC](https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602/4 "2014-11-04T22:14:33Z")

</div>

I actually like using var\_dump myself, but anything that helps people learn debugging skills is a good thing!

---

<div class="post-metadata">

**Author:** ![Redscouse](https://www.phphelp.com/user_avatar/www.phphelp.com/redscouse/32/124_2.png) [@Redscouse](https://www.phphelp.com/u/Redscouse)\
**Post date:** [November 8, 2014, 7:48pm UTC](https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602/5 "2014-11-08T19:48:47Z")

</div>

I wrote a little function many moons ago that I still use to this day.  
It defaults to using print\_r if passed in a single value - or an optional arg (true|false) and you can get a backtrace also.

Now, here’s the juicy bit, pass in an array and i can switch between var\_dump|print\_r. Show a backtrace (or not), add a label (handy for loops!) and pass in the last param as true and i can halt the script using exit.

Probably not the greatest debugging script ever written however it serves a purpose.  
Feel free to use it as you wish - or not as the case may be 😛

Red 😉

[php]  
/\*

- my debugging function, accepts a single value or array.

- If $debug is a single value, will print\_r the thing and

- a backtrace. If $debug is an array, the structure is:

- $debug[0] = thing to debug.

- $debug[1] = name of thing to debug.

- $debug[2] = if true use var\_dump() instead of print\_r

- $debug[3] = if true will print\_r a backtrace.

- $debug[4] = if true will halt the script. (exit())

- Example:

- debugging(array( , , \<vardump|print\_r\>, , ));

- debugging(array($object, ‘Object Structure’, true|false, true|false, true|false));  
\*/  
function debugging($debug, $backtrace=false) {

---

<div class="post-metadata">

**Author:** ![TearFromDevil](https://www.phphelp.com/letter_avatar_proxy/v4/letter/t/e9c0ed/32.png) [@TearFromDevil](https://www.phphelp.com/u/TearFromDevil)\
**Post date:** [November 13, 2014, 9:55am UTC](https://www.phphelp.com/t/modern-web-development-a-tutorial-series/23602/6 "2014-11-13T09:55:10Z")

</div>

Very easy to understand Very useful
