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

NetTuts.com:
Programming With Yii2: Working With Asset Bundles
Jun 10, 2015 @ 10:42:30

NetTuts.com is back with another part in their "Programming with Yii2" series today. In this new post they focus on asset bundles, pieces of functionality that let you easily manage things like Javascript and CSS files automatically.

In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. In this tutorial, I'll show you how to add custom JavaScript and CSS scripts and libraries to your Yii application. Yii uses a concept it calls Asset Bundles to make it easier to manage these resources. For these examples, we'll continue to build on the simple status application from previous tutorials.

They start with an introduction to asset bundles and how to set them up in the framework and the resulting HTML markup to include the involved files. They show you how to create a simple bundle and load it into your application. A screenshot is included showing a result of the inclusion.

tagged: yii2 framework series programming asset bundles javascript csss

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-working-with-asset-bundles--cms-23226

Benjamin Eberlei:
Integrate Symfony and Webpack
Feb 26, 2015 @ 10:21:40

In his latest entry Benjamin Eberlei shows how he integrated Symfony and Webpack, a tool that makes it simpler to package up multiple assets (like Javascript or CSS files) and reduce them down to combined files, reducing the overhead on page loads.

Asset Management in Symfony2 is handled with the PHP based library Assetic by default, however I have never really connected to this library and at least for me it usually wastes more time than it saves. [...] While researching about React.JS I came across a tool called Webpack which you could compare to Symfony’s Assetic. It is primarily focussing on bundling Javascript modules, but you can also ship CSS assets with it.

He talks about some of the main benefits to using the Webpack tool including a built-in web server to serve up the assets and a "hot reload" plugin that refreshes when assets change. He then gets into a more practical example, showing how the tool works with a typical asset structure in a Symfony application. He shows how it uses the internal server to prevent the need for a complete rebuild each time. He also shows how to install and configure it through Symfony and loading the Javascript file in your Twig template. Finally he shows how to run a build, the resulting output and the integration he mentioned with React.js.

tagged: symfony asset webpack tool tutorial introduction configuration install

Link: http://www.whitewashing.de/2015/02/26/integrate_symfony_and_webpack.html

SitePoint PHP Blog:
Asset Access Restriction Methods – Block Unwanted Visitors
Sep 05, 2014 @ 10:11:45

In a new tutorial from the SitePoint PHP blog today Jeroen Meeus looks at a way to protect parts of your application from being used and abused. He shows you how to protect various parts of you site, including images and actual pages, with the help of either your web server or bits of code.

When building an awesome web app or website, we sometimes want people to be able to embed parts of our web app/website into their own. That could be an iframe holding a ‘like’ button, a simple image that they want to reuse or even our entire app embedded in an iframe. But how do we control who has access, who is allowed to use up our bandwidth and query our service? We define the problem as controlling access to assets. By assets we mean: anything that can be queried from our site.

He talks about the problem of "lifting" content and how to fall back to a "deny all, allow some" mentality. He starts with examples of Apache configurations that use mod_rewrite to only allow requests that come from the current domain (trusted) and the "files" directive coupled with Deny/Allow. He also includes an nginx example, showing the same request handling. The code examples show how to use PHP and Javascript to prevent access the same way.

tagged: asset protection method webserver configuration code tutorial

Link: http://www.sitepoint.com/asset-access-restriction-methods-block-unwanted-visitors/

SitePoint PHP Blog:
Getting Started with Assetic
Apr 14, 2014 @ 10:37:00

The SitePoint PHP blog has a new post from Lukas White today looking at the Assetic asset management library and how you can get started using it in your application.

There was a time when asset management meant little more than inserting a <link> tag or two and a couple of <script> tags into your HTML. Nowadays, though, that approach just won’t cut it. There’s performance, for one thing. [...] Also, as client-side applications have become more and more sophisticated, managing dependencies amongst scripts and libraries has become increasingly complex. Furthermore, technologies such as Less, Compass and Coffeescript require assets to be compiled, adding yet another step to the process of managing assets. In this article I’m going to look at a PHP package called Assetic which helps manage, compile and optimize assets such as scripts, stylesheets and images.

He briefly discusses asset management first, just to get everyone on the same page as far as what "assets" are and some considerations about their use. Next is an introduction to the Assetic library itself and the install/usage of a simple "AssetCollection" object. He also shows how to add assets to the object and how to configure compression and generation of the files (like with LESS). He also shows how to use the AssetManager and FilterManager object types along with the AssetFactory handler. Finally, he talks about some of the sample output and caching the tool can do with file-based cache handling.

tagged: assetic introduction asset tutorial javascript css less compress

Link: http://www.sitepoint.com/getting-started-assetic

DZone.com:
Assetic: JavaScript and CSS files management
Aug 05, 2011 @ 09:19:26

On DZone.com today Giorgio Sironi introduces you to Assetic, an asset management tool that helps you keep things organized and easily requested by your application.

Assetic is a PHP library for managing the deployment of your assets: JavaScript, CSS and other resources which will be requested by the browser. The library has been created by Kris Wallsmith from OpenSky, an e-shop where many of the active members of the PHP community work, or worked (see Jonathan Wage/Doctrine 1 and Bulat Shakirzyanov/Imagine.)

Giorgio compares it to the more traditional method (putting them in a public folder) and how Assetic gives you an advantage over this setup. The main feature of the tool is to bundle all of your assets into one file that is then sent to the browser and interpreted there reducing the need for HTTP calls to request multiple files. An example is included showing the creation of an asset collection and the output of the files all combined into one string.

tagged: assetic asset management css javascript public organize

Link:

Paul Reinheimer's Blog:
IIS7 The Leap of Faith
Nov 09, 2007 @ 07:52:00

Paul Reiheimer has set a goal for himself in light of some of the recent advancements that Microsoft has made on the PHP front - to create a successful PHP-driven, IIS served website.

In an effort to learn more about IIS (which a number of my students and contracting contacts seem to use), I have decided to challenge myself: To design, build, and launch a PHP based site, and receive at least 1,000 unique visitors a day by Feb 28, 2008, served from an IIS7 server.

Among his assets are a license to use the IIS software and a designer help with the look and feel. He also sets out requirements for the project including a local testing server, the public web host and that PHP has to be used (not something like phlanger).

tagged: project microsoft iis server leapoffaith asset requirement project microsoft iis server leapoffaith asset requirement

Link:

Paul Reinheimer's Blog:
IIS7 The Leap of Faith
Nov 09, 2007 @ 07:52:00

Paul Reiheimer has set a goal for himself in light of some of the recent advancements that Microsoft has made on the PHP front - to create a successful PHP-driven, IIS served website.

In an effort to learn more about IIS (which a number of my students and contracting contacts seem to use), I have decided to challenge myself: To design, build, and launch a PHP based site, and receive at least 1,000 unique visitors a day by Feb 28, 2008, served from an IIS7 server.

Among his assets are a license to use the IIS software and a designer help with the look and feel. He also sets out requirements for the project including a local testing server, the public web host and that PHP has to be used (not something like phlanger).

tagged: project microsoft iis server leapoffaith asset requirement project microsoft iis server leapoffaith asset requirement

Link: