PHP framework suggestions?

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

PHP framework suggestions?

Postby caltuna » 28. July 2009 01:08

This is a bit off-topic but not too much.

I have a large, legacy web-service called http://www.jaya123.com that I want to re-write (about 90,000 lines of PHP code).

This time I think I'd like to use an MVC framwork. The ones I've read the docs on are:

Zend: wow... it's huge and really confusing.
CakePHP: I sort of understand this one, but it seems more complex that it has to be.
Code-Igniter: easy to understand but maybe not having enough classes?

Have any of you had success with any PHP framework out there that you might recommend?

Al
caltuna
 
Posts: 111
Joined: 05. May 2009 16:35

Re: PHP framework suggestions?

Postby MegaChriz » 28. July 2009 08:25

I created my own framework (which isn't actually complete yet). For the view I use Smarty.

Another framework I know that exists is Symfony. I don't know how complex it is, since I never used it.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X

Re: PHP framework suggestions?

Postby caltuna » 28. July 2009 15:44

I've looked at Smarty before and while it is good for what it does, it is not an MVC (model, view, controller) thing. While it helps in isolating presentation code from business logic, it does not go as far as a real framework. I'll look at Symfony. I spent last night reading the CakePHP manual. I don't see where it is any better than CodeIgniter, but I still have a lot to learn on all of this stuff.

Thanks.
caltuna
 
Posts: 111
Joined: 05. May 2009 16:35

Re: PHP framework suggestions?

Postby MegaChriz » 29. July 2009 20:00

Yes, Smarty isn't a framework. But Smarty is a good option for the View part (especially if you would decide to create your own framework).

Look at this:
Code: Select all
<table>
<?php
foreach ($aArray as $sKey => $mValue)
{
?>
   <tr>
      <td><?php echo $sKey; ?></td>
      <td><?php echo $mValue; ?></td>
   </tr>
<?php
}
?>
</table>

In Smarty:
Code: Select all
<table>
{foreach from=$aArray key=sKey item=mValue}
   <tr>
      <td>{$sKey}</td>
      <td>{$mValue}</td>
   </tr>
{/foreach}
</table>
The Smarty-code is better readable in mine opinion.
Before I used Smarty, I forgot many times to place the echo-command, or the ';'. Or I forgot to close a if or foreach.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X

Re: PHP framework suggestions?

Postby caltuna » 30. July 2009 04:32

I think Smarty is OK but if I'm going to use a commercial framework which has its own overhead, I'm not sure I want to add another layer of complexity. Smarty has it's own syntax and it's own language quirks. I've used it before. It has been around for many years now. I tend to like to keep things as simple as possible and with the least learning curve.
caltuna
 
Posts: 111
Joined: 05. May 2009 16:35

Re: PHP framework suggestions?

Postby izym » 31. July 2009 12:48

There is no reason to use Smarty. First of all, no matter how much you optimize a template engine, PHP will be faster. Not to mention it doesn't really matter to the template coder, whether he has to learn a little bit of PHP or Smarty. The example code you wrote can be shortened and made more human-friendly:

Code: Select all
<table>
<?php foreach ($aArray as $sKey => $mValue): ?>
    <tr>
        <td><?= $sKey ?></td>
        <td><?= $mValue ?></td>
    </tr>
<?php endforeach ?>
</table>

I don't see how that is much more complicated than Smarty, in fact I think it is way more simple and logical. Using the following code requires short_tag to be enabled in PHP.

Code: Select all
<?= $var ?>

Alternatively the following can be used, although a bit longer to write:

Code: Select all
<?php echo $var ?>

The semicolon is optional when that statement is the last one in that block of PHP code (by block I mean inside a php open and close tag.)
izym
 
Posts: 2
Joined: 31. July 2009 12:38

Re: PHP framework suggestions?

Postby annyphp » 29. December 2010 09:43

PHP Framework is built for PHP developers who need elegant toolkit to create full-featured web applications. It aims to speed up the creation and maintenance, and also to replace the repetitive coding tasks by power, control and pleasure.

Recommendede: CakePHP, CodeIgniter.
All of PHP Framework projects are listed on PHPKode.com
annyphp
 
Posts: 8
Joined: 01. December 2010 02:24


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 19 guests