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

SitePoint PHP Blog:
Yii 2.0 ActiveRecord Explained
November 20, 2014 @ 09:08:31

The SitePoint PHP blog has a new tutorial posted introducing you to using ActiveRecord in the Yii2 framework to access the information in your databases. The Active Record design pattern where a single object corresponds to a record in the database (and can be manipulated as such).

The ActiveRecord class in Yii provides an object oriented interface (aka ORM) for accessing database stored data. Similar structures can be found in most modern frameworks like Laravel, CodeIgniter, Symfony and Ruby. Today, we'll go over the implementation in Yii 2.0 and I'll show you some of the more advanced features of it.

He introduces the "Model" class first, the based of the ActiveRecord handling, and its parts: attributes, validation and scenarios. He then gets into the creation of the a model instance based off of a table (SQL structure provided) around authors and articles. He includes the code showing how to create a simple model, add in relations and putting it to use. He also shows how to use the built in "find" handling to locate records. Finally he gets into some of the more advanced topics including checking if attributes are "dirty", the "arrayable" functionality and using events/behaviors/transactions on the models.

0 comments voice your opinion now!
yii2 framework activerecord tutorial introduction

Link: http://www.sitepoint.com/yii-2-0-activerecord-explained/

SitePoint PHP Blog:
Re-introducing FuelPHP
November 10, 2014 @ 10:51:23

On the SitePoint PHP blog today they've posted a new tutorial that reintroduces you to FuelPHP, the framework that was (sort of) the successor to the CodeIgniter framework. It was started by some of the ex-CI developers in an effort to make a more robust, yet simple PHP framework for PHP 5.3+.

As a PHP developer, I have been a consistent user of different PHP frameworks, mostly focusing on CakePHP. Recently, I felt the need to go framework shopping and I have many valid reasons for choosing FuelPHP. It has a built-in modular structure and complete flexibility with emphasis on community. Before Fuel, I was a CakePHP user and just like Cake, Fuel is a huge community driven framework.

The author walks you through the installation process (via the framework's own "oil" command line tool) and dives into some example code quickly after that. He shows how to create a simple "Hello World" route and generate the scaffolding (code generation for the MVC pieces) including migrations. He creates a simple "users" table and adds some authentication checking to the controller. Then in the view he sets up a simple login form, requesting username and password and outputting any errors that might pop up during the authentication process.

0 comments voice your opinion now!
fuelphp framework introduction mvc authentication example

Link: http://www.sitepoint.com/re-introducing-fuelphp/

Symfony Blog:
Symfony November Camp in Sweden
November 06, 2014 @ 10:53:05

On the Symfony blog they've made the announcement about the Symfony November Camp happening in Sweden (back for their second time) November 14th in Stockholm.

As an organizer of the Swedish Symfony community I'm happy to say that we are hosting our second Symfony Conference. It is a one-day, single-track conference with speakers from 6 countries. The event takes place in Stockholm on November 14th. We will have two workshops the day before the event with Matthias Noback and Magnus Nordlander. One is a workshop on getting started with Symfony, and the other is for advanced Symfony application architecture. Both of our workshops are small groups, to ensure that you'll have plenty of access to the trainer.

They have a great list of speakers lined up for the day's event including Matthias Noback, Mathias Verraes and Raul Fraile. Tickets for the conference itself are 109 Euro and the training is 439 Euro. You can find out more about the event and pick up tickets on the November Camp website.

0 comments voice your opinion now!
symfony framework community conference sweden camp november

Link: http://symfony.com/blog/symfony-november-camp-in-sweden

Zumba Tech Blog:
Caching CakePHP 2.x routes
October 28, 2014 @ 10:47:02

On the Zumba Tech Blog today there's a new post with some helpful hints around caching routes in CakePHP 2.x to help optimize the requests and response time even further.

At Zumba we are continuously looking for optimization in our applications. These optimizations help to reduce the server loads, consequently reducing the number of servers and saving money. Besides that, it gives a better user experience for the end user by serving content faster and in some cases saving on consumer bandwidth (specially for mobile users). This week we profiled our app using Xdebug profiler and we identified the router was responsible for a big part of the request time. [...] In order to optimize the routing time, we started looking at options to optimize our routing process. After some research and deep checking in our codebase as well as CakePHP's code, we found we could cache the routes easily.

Taking a cue from how FastRoute does their caching, their implementation uses a temporary file with the routes completely resolved and written out for easier handling. Since the routing is relatively static, this method works well and can be much faster than resolving them every time. They talk about some of the work done to optimize their method and some of the issues they came across during the process.

0 comments voice your opinion now!
cakephp framework cache route file resolve

Link: http://tech.zumba.com/2014/10/26/cakephp-caching-routes/

Angular Tips:
Working With a Laravel 4 + Angular Application
October 28, 2014 @ 09:11:31

On the Angular Tips site today they have a tutorial posted showing you how to combine the power of the Angular JS frontend framework with a Laravel backend. They walk you through the full process of getting an application up and running, including a bit of actually functionality (not just a "Hello World").

So you decided that Laravel is a great choice for a backend and that Angular is going to fit perfectly as the framework of choice for the frontend. Yeah! That is correct and I am starting to like you. How to start? So many question, so little time.

They start by getting everything you'll need installed, both on the Laravel and Angular sides. Then it gets into the actual development of the application, changing up the default Laravel page to include Angular and a little test to be sure it's working correctly. With this working correctly (after a little route updating too) they get to the more real-world application: a listing of TV shows generated from a dataset on the Laravel backend. They include all the code you'll need to create the frontend app and display the results.

0 comments voice your opinion now!
laravel tutorial angularjs application frontend framework

Link: http://angular-tips.com/blog/2014/10/working-with-a-laravel-4-plus-angular-application/

Benjamin Eberlei:
Symfony All The Things (Web)
October 27, 2014 @ 09:18:52

In his latest post Benjamin Eberlei talks about some of his reasoning to want to Symfony all the things when it comes to building web applications. Actually, it's the results of a discussion he had with a coworker about when is the right point to move from a micro-services infrastructure to a full-stack framework like Symfony.

We use microservice architectures for the bepado and PHP Profiler projects that Qafoo is working on at the monent. For the different components a mix of Symfony Framework, Silex, Symfony Components and our own Rest-Microframework (RMF) are used. This zoo of different solutions sparked a recent discussion with my colleague Manuel about when we would want to use Symfony for a web application.

He talks about some of his own reasons for making the choice including things like the HttpKernel and having a well documented and standardized solution. He notes that most of his reasons are more because of his previous exposure to the framework and could be very similar for others and other frameworks, though. He then extends on the "Hello World" code from the previous post and makes an improved minimal Symfony app with just seven basic parts (including configuration files).

0 comments voice your opinion now!
symfony framework minimal reasons preference webapp

Link: http://www.whitewashing.de/2014/10/26/symfony_all_the_things_web.html

Symfony Blog:
The Symfony Project turns 9!
October 22, 2014 @ 11:50:14

There's some major news from the Symfony project (with matching post on their blog) worth celebrating - the framework and project are celebrating nine years since the first commits were made by Fabien Potencier himself.

Where does the time go? This milestone reminds us all of how Symfony has become an important part of our professional lives and been changing the way we work with code for almost a decade! (We won't even talk about the whole "we're all getting older" thing!) [...] Over the last several years, the Symfony project has completely and continually reinvented itself. Originally a pure MVC framework with some auto-magical features, now it's both a set of decoupled components and a full-stack Request-Response framework backed by a vast development community.

They also talk some about the Symfony community and include a special thanks to all of the developers that have contributed their talents, both in code and documentation, to the framework over the years.

0 comments voice your opinion now!
symfony framework anniversary celebrate nine years

Link: http://symfony.com/blog/the-symfony-project-turns-9

Matt Stauffer:
Laravel 5.0 - Middleware (replacing Filters)
October 15, 2014 @ 10:18:00

In a new post to his site Matt Stauffer looks at a feature of the upcoming version 5 of the Laravel framework, middleware, and how it will replace the current Filter handling. This is part nine in a series about the new features coming in Laravel (the rest are linked at the top of the article).

If you've been following along with my previous blog posts about Laravel 5.0, you may have noticed that route filters were first moved to be their own directory and class structure, and then eventually they mysteriously disappeared. You may have even noticed that references to Middleware showed up in their place.

He starts off by defining what "middleware" actually is and how it fits into the overall execution flow of the application. He describes it as "a series of wrappers around your application that decorate the requests and the responses in a way that isn't a part of your application logic." He then gets into the code examples, showing how to write a simple Laravel-friendly middleware that blocks odd port requests to the application. He includes the configuration updates to integrate it, how to control where it runs and using before and after "filters" inside the middleware.

0 comments voice your opinion now!
series part9 tutorial laravel framework filter middleware introduction

Link: http://mattstauffer.co/blog/laravel-5.0-middleware-replacing-filters

SitePoint PHP Blog:
7 Reasons to Choose the Yii 2 Framework
October 14, 2014 @ 13:52:58

The SitePoint PHP blog has a new post today from Matthew Beaumont with severn reasons to choose Yii2 as your framework for your next project. The Yii framework is a full-stack framework option and has been around for a long time. It recently reinvented itself with version 2 and has improved a lot of the original functionality.

Late last year, SitePoint published an article highlighting the top PHP frameworks. Tied for the number four spot was the Yii (pronounced Yee) Framework. At that time the latest version of the framework available was 1.1.14. Recently, Yii 2.0 was made available, so you can begin to use it in production. While we did cover it recently when it was still in RC status, it just reached full release status, and we feel like it's time to revisit the topic with some reasons for choosing it over alternatives.

He includes brief descriptions with each of his seven points (some with links to other information too):

  • Easy to Install
  • Utilizes Modern Technologies
  • Highly Extensible
  • Encourages Testing
  • Simplifies Security
  • Shorten Development Time
  • Easy to Tune for Better Performance

Some of the items in the list include code snippets showing how they're implemented as well. Be sure to give it a look if you're trying to decide on your next framework or toolset.

0 comments voice your opinion now!
yii2 framework top7 list choose

Link: http://www.sitepoint.com/7-reasons-choose-yii-2-framework/

Reddit.com:
Would you take a job where you had to use a custom MVC framework?
October 08, 2014 @ 12:57:00

There's an interesting discussion happening in the /r/php subreddit on Reddit.com that asks about taking a job if a custom framework was involved.

i recently got a new job and whilst I'm working my notice period I've been tasked to find my replacement. One of the big questions my boss has is whether a developer would mind taking over a MVC framework I built specifically for the company. (I would explain why we didn't use Laravel / Symfony / Zend etc. but that's a whole post in itself). The framework is conventional and should feel familiar to someone with Laravel experience... But at the end of the day it's totally proprietary. It's built to PHP-FIG standards and would come with full documentation. So, would you have any issues taking the job, or would you be put off?

There's opinions shared that lean both ways, but there seems to be a large majority that strays more heavily into the "no" column. They suggest that, with all of the great and well-developed PHP frameworks already out there, a custom one would probably cause more problems that it solves. While there's plenty of technically oriented comments, there's also a few that are more "high level" looking at the reasoning for taking the job (hint: it's not just about technology) and what the needs/requirements of the business are.

0 comments voice your opinion now!
opinion custom mvc framework work

Link: http://www.reddit.com/r/PHP/comments/2il722/would_you_take_a_job_where_you_had_to_use_a/


Community Events





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


introduction podcast series install composer symfony update laravel voicesoftheelephpant framework library opinion version tool package security community release language interview

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