Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Your First PHP Code
Nov 02, 2017 @ 17:34:02

On the SitePoint PHP blog there's a new post from author Tom Butler that starts from the very beginning and shows you how to write your first PHP code. The article is an excerpt from the SitePoint book PHP & MySQL: Novice to Ninja, 6th Edition.

PHP is a server-side language. This concept may be a little difficult to grasp, especially if you’ve only ever designed websites using client-side languages like HTML, CSS, and JavaScript.

A server-side language is similar to JavaScript in that it allows you to embed little programs (scripts) into the HTML code of a web page. When executed, these programs give you greater control over what appears in the browser window than HTML alone can provide. The key difference between JavaScript and PHP is the stage of loading the web page at which these embedded programs are executed.

At this point they assume you've already set up the server to allow for PHP execution. They then provide an example of a HTML page with a bit of PHP that generates a random number. It then gets into some of the basic language syntax and statements and how they're used in the PHP code.

tagged: first code tutorial introduction language book excerpt

Link: https://www.sitepoint.com/first-php-code/

Laravel News:
Dynamic templates in Laravel Blade with View::first
Sep 14, 2017 @ 15:54:11

On the Laravel News site there's a tutorial posted showing you how to use Blade's View::first functionality to dynamically show a template if it exists.

When building dynamic components or pages sometimes we want to display a custom template if it exists or otherwise fall back on a default one.

[...] We can solve this problem with a series of conditionals or by using view()->exists() to check if a custom template exists or not, however, Laravel 5.5 brings us a better and more elegant way.

A screencast of the functionality in action is included as well as a text-only version with code samples showing the previously used "if view exists" check and the refactor to use View::first instead.

This dynamic view loading feature was added to Blade in Laravel v5.5 and is a great way of keeping your controllers simple by avoiding extra conditionals when dealing with dynamic templates.
tagged: dynamic template laravel blade view first refactor laravel55

Link: https://laravel-news.com/viewfirst

DotDev.co:
Step by Step Guide to building your first Laravel Application
Mar 07, 2016 @ 15:25:04

On the DotDev.co site they've posted a tutorial showing you how to create your first Laravel application. In their case they show how to create a simple link collection tool to help illustrate the process.

The Laravel framework has experienced exponential growth since it’s initial release in 2011. In 2015 it became the most starred PHP framework on GitHub and has risen to be the go-to framework for people all over the world. [...] My goal with this is to create a guide for those just learning the framework. It is setup to take you from the very beginning of an idea into a real deployable application.

He starts by pointing out some prerequisites you'll need (like a local PHP environment and having PHPUnit installed). He then gets into the first step in any good application, planning, and some recommendations to think about. Once the planning is done, then the real code starts. He's broken it up into a few sections to help make it easier to follow:

  • The first steps (setting up the basic Laravel application)
  • Building a list of links
  • Submitting Links

In each step he also provides examples of tests that can be written and used to ensure your application is working as expected. Templates for the link output and the submission form are also included.

tagged: laravel application introduction beginner links tutorial first

Link: https://dotdev.co/tutorials/step-by-step-guide-to-building-your-first-laravel-application/

SitePoint PHP Blog:
Nette Framework: First Impressions
Jun 23, 2015 @ 14:41:33

The SitePoint PHP blog has a new article posted with some first impressions of the Nette framework, a larger but not often talked about PHP framework that showed up in their framework survey results in third place.

SitePoint’s PHP channel conducted its annual survey on the most popular framework of 2015 and the results were discussed here. We saw some familiar names: Laravel, Symfony2, Phalcon, Silex, Slim, etc. But wait, what is this: Nette? According to the survey result, it ranked number 3 in both “at Work” and “in Personal Projects”, just tailing the two giants: Laravel and Symfony2.

I had never heard of this framework before the survey results got published. A framework so popular is worth looking into. Thus, in this article, we will take a look at Nette, see what it can do and discuss some of the features.

The Nette framework is a "set of decoupled and reusable PHP components" that combine into a complete framework (including templating, error tracing and unit testing integration). He follows along with their Getting Started guide and helps you get a demo application copy up and running (via Composer). He then goes through the project structure, the "Adminer" tool, route handling, controllers/actions and the "Latte" templating engine. He also covers basic security functionality and some other interesting features like the "Tracy" debugger and the use of the integrated unit test functionality.

tagged: nette framework first impression overview demo project tutorial

Link: http://www.sitepoint.com/nette-framework-first-impressions/

Matthew Setter:
The Path To The First PHP Conference Talk
Feb 24, 2015 @ 18:08:10

Matthew Setter was encouraged by some recent conversations and conference sessions about getting out into the PHP community and taking up presenting at conferences. In his latest post he talks about some of these conversations and his ideas moving forward.

[The PHP UK Conference 2015] was an especially meaningful conference for me, as the opening keynote, by @coderabbi, moved me to take more action, more serious, dedicated, and focused action than I’ve taken to date. [...] I sat there thinking “WOW, I’m really a part of the community“. I also started thinking I want to contribute more, and build a profile just as big as his, and many of the others at the conference. So what to do?

He talks about the encouragement from others he's gotten to get up and present at a conference and the feedback he's gotten on his (unfortunately so far) rejected submissions. He's renewing his effort, though and has plans to document his progress via a "pseudo-journal" during his journey to hopefully serve as a guide to others wanting to share their knowledge with the community. He talks some about his plan moving forward and the work he's doing on the public speaking side to improve his skills.

While not for everyone, speaking at conferences is a great way to share experience, information and start conversations about new technology. If you've ever thought about making the move, follow Matthew's journey or check out these other articles to help you get started.

tagged: first conference talk public speaking phpuk15 community

Link: http://www.matthewsetter.com/path-first-php-conference-talk/

KillerPHP.com:
Why PHP should be the first language you learn
Feb 13, 2014 @ 16:43:46

On the KillerPHP.com site there's a new post from Stefan Mischook where he suggests that PHP is the first language you should learn if you're new to development.

Anyone who reads my stuff knows that if I am anything, I am practical. So when it comes to learning (and teaching) programming to someone new to the whole programming game, for several pragmatic reasons, I think PHP by far is the best language to begin with. Here are some of the reasons: it is easy to learn, it is the most popular web scripting language and it is fast to program with.

He shares these thoughts and a few more in a short video (or here on YouTube).

tagged: first language video opinion programming learn

Link: http://www.killerphp.com/articles/why-php-should-be-the-first-language-you-learn

Samantha Quinones:
Project Laravel - Session 1: First impressions
Feb 10, 2014 @ 16:18:54

Recently Samantha Quinones started out a new project with Laravel to find out more about this popular framework. In her latest post she shares some of her first impressions of working the initial steps of her application.

I was super excited when I found a couple of free hours to finally sit down with Laravel and kick off my little blog project. That two hour time box turned out to be pretty important to this effort. [...] I won’t go in to details on a topic as well-trod as that, but I think it speaks extremely highly of Laravel’s approachability that I was able to build out a reasonably rich authentication system in a little more than an hour, including command-line tools to provision and manage users.

She also talks some about some of the things she "wasn't quite comfortable with" like the framework's use of facades. She mentions a post from Taylor Otwell to help explain some of the non-facade methods and suggests that if some of this and the "magic" with the dependency injection container were mentioned in the documentation, the framework might receive a bit less criticism for them.

tagged: project laravel blog framework first impressions

Link: http://www.tembies.com/2014/02/project-laravel-first-impressions/

PHP.net:
PHP 5.4 beta1 released
Sep 27, 2011 @ 15:52:20

PHP.net has officially announced the release of the first official beta of the PHP 5.4.x series today - PHP 5.4 beta1.

The PHP development team is proud to announce the first beta release of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviors. Windows binaries can be downloaded from the Windows QA site.

Features added in this beta include several bug fixes, the addition of a callable typehint, a switch to timezone guessing (UTC is assumed if not set) and the mysql/mysqli/pdo_mysql extensions now use mysqlnd by default. There's a lot of smaller changes too - check out the latest NEWS file for the complete list.

tagged: php54beta1 release first development review testing

Link:

Derick Rethans's Blog:
Obtaining the next month in PHP
Jan 08, 2010 @ 17:35:12

Derick Rethans (master of all things date and time in PHP) has a new post to his blog showing how to correctly get the "next month" since the date string parser doesn't understand how to use that string directly.

Over and over again PHP users complain that next month in PHP's date-string parser doesn't go to the next month, but instead skips to the one after next month.

He describes what happens internally, how PHP bumps up the month and counts the number of days, and how you can use some of newer features in the PHP 5.3 release to get the first day of the next month. Specifically, this means using the "first day of next month" string for the modify() call on the DateTime object. If you're not on PHP 5.3 yet, Derick also includes a method in the comments to do it a slightly different way.

tagged: datetime next month first day

Link:

PHPBuilder.com:
The ABC's of PHP Part 3 - Basic Script Building in PHP
Mar 26, 2009 @ 12:56:40

PHPBuilder.com has posted the next article in their "ABCs of PHP" series looking at some basic techniques for building your first scripts.

Welcome to part 3 of my 10 part series on PHP. In the first two parts I introduced you to the language and to what software you needed to run it. In this episode we will look at some simple PHP syntax, and we'll write a couple of small scripts to get our feet wet, and get a feel for the language.

Their first script mixes HTML and PHP together to make a "Hello World" web page. They also give the example of a phpinfo function call to get the settings for the current PHP installation.

tagged: abc introduction first script technique phpinfo

Link:


Trending Topics: