News Feed
Sections




News Archive
feed this:

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

NetTuts.com:
Programming With Yii2 Rich Text Input With Redactor
June 19, 2015 @ 10:38:55

NetTuts.com continues their series about programming with the Yii2 framework in this new article moving on to the use of the Redactor rich text editor that comes bundled with the framework.

In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. In this tutorial, I'm going to introduce you to using the rich text editor Redactor within the Yii Framework. For these examples, we'll continue to imagine we're building a framework for posting simple status updates, e.g. our own mini-Twitter.

Thanks to the Yii community purchasing an unlimited license for the Redactor rich text editor, it's easy to install and use via the "yii2-redactor" extension. They help you get it installed and update a sample form to use it instead of the normal basic HTML textarea for content input. They also show you how to add image support and what it looks like both inline in the editor and the resulting HTML output.

0 comments voice your opinion now!
yii2 series tutorial programming redactor richtext editor image

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-rich-text-input-with-redactor--cms-23174

Luciano Mammino:
Symfony security authentication made simple (well, maybe!)
June 04, 2015 @ 10:36:41

Luciano Mammino has a quick post to his site with information that tries to help make Symfony authentication simple (well, maybe).

The Symfony2 security component has the fame of being one of the most complex in the framework. I tend to believe that's partially true, not because the component is really that complex, but because there are (really) a lot of concepts involved and it may be difficult to understand them all at once and have a clear vision as a whole.

[...] Going back to the Symfony2 security component, the point is that I found out difficult at first glance to get a clear idea of what is going on behind the scenes and what I need to write to create a custom authentication mechanism. So in this post I will try to collect few interesting resources that helped me understanding it better and a graph I drawn to resume what I learned.

He provides a good list to some of the other resources that helped him along the way including several blog posts and links to the Symfony "cookbooks" about creating custom providers. He also shares a graph showing the full flow of the Symfony authentication process including commentary about each step.

0 comments voice your opinion now!
symfony authentication simple resources graph flow provider

Link: http://loige.co/symfony-security-authentication-made-simple/

New Media Campaigns:
Docker for PHP Developers
June 02, 2015 @ 10:29:38

The New Media Campaigns site has posted a new tutorial today introducing PHP developers to Docker, the handy tool to create containers for your applications a bit simpler and more efficient than just something like Vagrant.

I've used Vagrant to manage local development servers for several years. Vagrant is, according to its official website, a tool to "create and configure light-weight, reproducible, and portable development environments." [...] However, Vagrant has one large downside-it implies hardware virtualization. This means each project runs atop a full virtual machine, and each virtual machine has a complete operating system that demands a large overhead in system resources.

[...] There is another solution, though. Have you heard of Docker? I first heard this word a year ago. It's all about containers, I was told. Awesome. What are containers?, I thought. I dug deeper, and I read all about containerization, process isolation, and union filesystems.

He starts with a brief introduction to what Docker is and two of the key concepts: containers and images. He then talks about how Docker is different from Vagrant, including the extensibility and lighter resource demands. Following all this he starts in on building an actual application in a container. He walks you through each step, including commands, to build the container and image that will result in the final instance running Ubuntu, MySQL, Nginx and PHP-FPM. He sets up a simple "Hello World" page and shows how to configure the Nginx server to serve it up as well as the MySQL server to cooperate with PHP and run locally.

0 comments voice your opinion now!
docker introduction container image configure server setup tutorial

Link: http://www.newmediacampaigns.com/blog/docker-for-php-developers

SitePoint PHP Blog:
Efficient User Timelines in a PHP Application with Neo4j
April 15, 2015 @ 12:41:25

In the latest post to the SitePoint PHP blog Christophe Willensen shows you how to use PHP and the Neo4j graph database to make efficient user timelines in your application. In this case, "timeline" should be thought of as something like a Twitter or Facebook status update feed.

Any social application you encounter nowadays features a timeline, showing statuses of your friends or followers generally in a descending order of time. Implementing such a feature has never been easy with common SQL or NoSQL databases. Complexity of queries, performance impacts increasing with the number of friends/followers and difficulties to evolve your social model are points that graph databases are eliminating. In this tutorial, we're going to extend the demo application used by the two introduction articles about Neo4j and PHP.

He starts off with a look at how to model the timeline in the graph database, showing different methods to create the relationships: one a direct user-to-post and the other via a linked list. He goes through the initial setup of the codebase and the sample dataset to populate the Neo4j database. He then includes code samples showing how to get the latest feed items for a user and displaying the results in a simple template (Twig-based). He also shows how to get the latest posts for the timeline and how to add a new post.

0 comments voice your opinion now!
tutorial neo4j database graph user timeline socialmedia

Link: http://www.sitepoint.com/efficient-user-timelines-php-application-neo4j/

SitePoint PHP Blog:
Creating Custom Field Formatters in Drupal 8
March 12, 2015 @ 12:29:01

The SitePoint PHP blog has a new tutorial posted today showing how to create custom field formatters in a Drupal 8 application. Custom formatters allow you to enhance the current functionality of objects in the application and extend them with additional functionality.

With the introduction of annotated plugins, a lot has changed in Drupal 8. We have a more streamlined approach to describing and discovering pieces of functionality that extend the core. Along with many other components, the former Field API (part of the larger and consolidated Entity API) is now based on plugins. In this tutorial we will go through defining a custom field formatter for an existing field (image). What we want to achieve is to make it possible to display an image with a small caption below it. This caption will be the title value assigned to the image if one exists.

They start with a new custom module, starting with just the YAML configuration. Then they help you create the field formatter as a plugin in the "Plugin/Field/FieldFormatter" namespace (code included). They explain how this code works and show how to add it as a hook to make it available to the template layer. Finally they show it in use and how it places the title value into the image caption in the result.

0 comments voice your opinion now!
drupal8 custom field formatter tutorial plugin image title

Link: Creating Custom Field Formatters in Drupal 8

SitePoint PHP Blog:
Discover Graph Databases with Neo4j and PHP
February 16, 2015 @ 11:49:51

The SitePoint PHP blog has a post today about combining PHP and Neo4j, a popular graph database, and create a simple application.

In this post, we'll be learning about Neo4j, the leading graph database, and ways to use it with PHP. In a followup post, we'll be building a proper graph application powered by Silex. [...] For the newcomers, here is a short introduction to graph databases and Neo4j, apart from the theoretical glance we threw at it last year.

For those not familiar with some of the concepts behind graph databases, they start with a quick introduction. They illustrate the concept of relationships with a few helpful images. They also cover the basics of Cypher, the language used in Neo4j database queries. They then show how to get the Neoxygen components installed to talk with the Neo4j database (via an HTTP API) and configuring a basic connection. The remainder of the post shows how to insert data into the database, including relationships, and pulling that information back out via PHP.

0 comments voice your opinion now!
graph database neo4j tutorial introduction neoxygen series part1

Link: http://www.sitepoint.com/discover-graph-databases-neo4j-php/

Laravel News:
Easy Image Processing in Laravel with Glide
January 30, 2015 @ 10:06:41

On the Laravel News site there's a new post sharing a video tutorial of how to use the Glide image handling library with your Laravel-based application.

Glide is a new package by Jonathan Reinink which is an on-demand image manipulation library. In this video he shows you how to set it up and the basic usage in Laravel 5.

In the tutorial Jonathan walks you through an introduction to the library and how it wraps around the Intervention image handling. He creates a basic application that, when an image endpoint is called, output the image with any given configuration options (like height and width). Glide is one of many packages making up The PHP League.

0 comments voice your opinion now!
laravel image processing glide library thephpleague screencast video

Link: https://laravel-news.com/2015/01/using-glide-laravel/

SitePoint PHP Blog:
Image Scraping with Symfony's DomCrawler
March 31, 2014 @ 09:06:43

On the SitePoint PHP blog today there's a new post showing you how to use the Symfony DomCrawler component to scrape content, images mostly, from a remote website. The DomCrawler is one component of the Symfony framework.

A photographer friend of mine implored me to find and download images of picture frames from the internet. I eventually landed on a web page that had a number of them available for free but there was a problem: a link to download all the images together wasn't present. I didn't want to go through the stress of downloading the images individually, so I wrote this PHP class to find, download and zip all images found on the website.

He talks briefly about how the class works and then gets into the contents of the class. He walks through all the code and explains in chunks what each part does in the lifecycle of the request. The end result is a Zip archive file of all images from the remote website, packaged up for easy transport.

0 comments voice your opinion now!
domcrawler symfony framework component tutorial image scrape

Link: http://www.sitepoint.com/image-scraping-symfonys-domcrawler/

CodeGeekz:
Cropping Images in PHP Based on their Entropy
February 03, 2014 @ 11:25:42

On the CodeGeekz site there's a new post showing you how to use the Imagick extension and a custom library to crop images based on their entropy (keeping the "busiest" part of the image).

The need to resize and crop images in order to create thumbs, is a very common scenario for most websites. For example a blog like this one uses images in the content of the posts, images which at some point are used to create a thumb for the homepage. In most cases, the thumb's dimensions are not dynamic but are static throughout the website in order to better fit the template. This however creates a major problem when we try to automatically resize and crop our images in the desired dimensions.

He starts with an example of the normal kind of cropping based on a given height and width. He points out an issue with "smart cropping" and resizing the image with the cropping is done. Instead, he's made use of Imagick in his library to produce a better cropped image based on the parts of the image with the most entropy.

0 comments voice your opinion now!
crop image entropy busy resize smart tutorial

Link: http://codegeekz.com/cropping-images-entrop/

SitePoint PHP Blog:
PHP and Neo4j Introduction to Graph Databases
January 13, 2014 @ 12:18:52

On the SitePoint PHP blog today they've posted a new tutorial by Mehul Jain about combining PHP and Neo4J, a popular graph database tool as an alternative to the typical table-driven database structure. This is the first part of a series and only explains some of the basics behind the technology. The actual PHP implementation comes next.

For a long time, data has been typically stored in tabular form so as to increase the indexing and readability. Nowadays, the trends are changing as Graph databases are quickly gaining popularity. In fact, it would not be wrong to call them "the future of DBMS". New to the world of graphs and databases? Don't worry, by the end of this introductory article you will have sound theoretical knowledge about the topic - just enough to easily glide through the rest of the series - actual implementation.

He starts with the basics - introducing the ideas behind graph databases and some of the most basic concepts behind them. He continues, looking at common uses for them including dealing with connected data and how it lets you "move through" the data rather than jumping from record to record. He includes some real world examples if this kind of data ranging from social networks to network management.

0 comments voice your opinion now!
graph databases introduction neo4j tutorial

Link: http://www.sitepoint.com/php-neo4j-introduction-graph-databases/


Community Events

Don't see your event here?
Let us know!


community project symfony introduction framework example series opinion yii2 podcast api interview list part2 composer application language programming laravel php7

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework