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

Symfony Finland:
What's on the Menu, Symfony?
Jan 28, 2016 @ 17:49:13

On the Symfony Finland site they've posted a tutorial about Symfony and menus, making use of the KnpMenuBundle to create flexible and easily configured menus with their own renderers.

Menus are a vital part of any web application or a website. Content Management Systems are traditionally a strong contender in this field as they are at their core just tools to create navigatable views to a pool of content. The Symfony Framework on the other hand is neutral when it comes to menus.

[...] There are a number of options for building menus in PHP, but the de-facto standard method for Symfony Framework is the KnpMenuBundle. It uses the KnpMenu library which is an object oriented PHP library for constructing and rendering menus.

The tutorial provides a simple example of using the bundle to create a menu with a handful of options and rendering it with a simple (included) ListRenderer. There's also an example of using a YAML configuration to create the menu and some example code of using a bit more complex and dynamic menu. They also talk a bit about content management systems, their use of menus and which they see as providing a better user experience than the others.

tagged: menu tutorial knpmenubundle symfony cms knplabs

Link: https://www.symfony.fi/entry/whats-on-the-menu-symfony

SitePoint PHP Blog:
How to Use GitHub's API with PHP
Mar 17, 2015 @ 15:11:39

The SitePoint PHP blog has a new tutorial posted showing you how to interact with the GitHub API via PHP thanks to the KnpLabs library to create a simple automation system to perform some simple tasks.

Github is one of the best ways to share code and collaborate. In this article, we are going to learn how to consume their API and how we can use it to accomplish some of our daily tasks. We are going to explore some of the daily tasks that can be accomplished through the Github API and build a small app using Laravel to illustrate the use cases. You can check the final result on Github.

They walk you through the setup of an application on the GitHub side and how to configure the related settings in your Laravel application. He shows how to bind the GitHub library to the app, set up some sample routes and build out controllers to:

  • List repositories
  • View repository content
  • Editing files
  • Viewing commits

Each item includes the code you'll need to make it happen, an example of the output you'll get from the API and how to use the data on your side in your views.

tagged: github api tutorial knplabs repository edit view content commits

Link: http://www.sitepoint.com/use-githubs-api-php/


Trending Topics: