2

I'm new to PHP.

I'm looking for some boilerplate code that that helps me get started on a new project, but not a complete framework. I'm thinking of something like the HTML5 Boilerplate, but for PHP.

I'd expect of such a boilerplate that it has some convenient ways to access a database, string manipulation, autoloading, etc.

Do you know any such PHP Boilerplate?

4
  • You mean something like a framework? Commented Apr 21, 2012 at 11:56
  • Accessing MySQL - maybe an ORM? Look at Propel or Doctrine, but be aware they're not suitable for absolute beginners, imo. Commented Apr 21, 2012 at 11:58
  • I guess he need a default php project structure with done MVC pattern or something. Commented Apr 21, 2012 at 12:18
  • I just want to template that includes class for sql CRUD operation, form validation, config and sort of things. I am reluctant to use orm because it is hard to optimize sql statement. Commented Apr 30, 2012 at 0:17

4 Answers 4

1

There are some Template Engines like:

Twig
Smarty

when you need a PHP Framework there are some Frameworks. Google them a hint:

Yii
Symfony2
Cake PHP

Sign up to request clarification or add additional context in comments.

3 Comments

I do not think asker meant html templates engines, didn't he?
I think this is a better question then the main question :D i don't know what he need.
@Stony : He appears (or appeared, since this question is from 2012) to be looking for something like HTML5 Boilerplate, but for PHP. He used the word template as a reference for what's really known as boilerplates or bootstraps, so I "fixed" the question to reflect this!
1

The best way is to make your own template. I don't think developers will whare with others their templates. But if you don't want waste couple of hours for making a template, you always can use some of PHP frameworks, like Yii, codeigniter, kohana, ZFM, cake, etc. But they are not just a simple templates by the way.

Comments

1

php is a template engine itsself!

don't use other template libraries, they just slow down the processing

example

<persons>
    <? foreach ($persons as $person): ?>
    <person>
        <firstname><?= $person>firstname ?></firstname>
        <lastname><?= $person->lastname ?></lastname>
    </person>
    <? endforeach; ?>
</persons>

mysql

there are several options like ORMs but for a beginner i would recommend to use PDO

3 Comments

Technically, it should be ($people as $person)
@VanNguyen lol that is just grammer ....lool
Persons is proper english too, it's just more formal than people :p
1

You could try CodeIgniter, Kohana or FuelPHP.

While they ARE frameworks, they're pretty lightweight and all have the kind of features you're looking for.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.