Easy to use/learn PHP framework? [closed] - cakephp

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I need to build a php app, and I was thinking about using a framework (never used one before). I've been browsing around some but most of them seems kinda complicated, I really liked what I saw about Symfony, but it looks like I will have to spend like a month until I really understand how to use it, and in one month I could code the app I have in mind 5 times without a framework. But I want to use one to "standardize" my code and prevent bugs.
So I was wondering if someone could share with me which php frameworks you think are easier to learn how to use.
My application will use mysql, and it will have some sort of "search engine" to search data that will be populated on the database using a few "scraper scripts" (that I also wants to code using the framework).

There are many questions answering this question here on StackOverflow and I was recently just in your position researching many different frameworks as I want to standardize my code as well.
I ended up choosing Codeigniter because I wanted something with good documentation, and that was very light (lighter == easier to understand IMO), and something that was not too strict. In Codeigniter if you really want to you can just code regular PHP and it lets you do that. I like this option because if I really get stuck on something, I just code it in raw PHP the way I know I can. I've only been using Codeigniter for a few weeks but the learning curve isn't too difficult and this is my first framework I've used.

Read through some of the previous discussions, and look out for ease of use advises:
https://stackoverflow.com/questions/2648/what-php-framework-would-you-choose-for-a-new-application-and-why
https://stackoverflow.com/questions/249984/php-framework-decision-analysis-paralysis
Why do I need to use a popular framework?
https://stackoverflow.com/questions/717836/kohana-or-codeigniter
If you want something easy to get started, you might want to look into the minimal frameworks:
https://stackoverflow.com/questions/694929/whats-your-no-framework-php-framework
https://stackoverflow.com/questions/141945/lightest-possible-php-mvc
https://stackoverflow.com/questions/3023818/any-procedural-non-oo-php-framework
But actually the big dozen are advisable if you want good documentation. Symfony and CakePHP are complex, CodeIgniter and the newer Kohana fork are beginner friendly. While there are many more to choose from. Pick a nice API, and maybe look out for one that explains the difference between MVC and MVP. Also for a lengthy list: http://matrix.include-once.org/framework/

My first choice would be cakePHP. Easy to learn, great documentation, api and a few good books:
Beginning CakePHP: From Novice to Professional – David Golding (good; start with this one!)
Super Awesome Advanced CakePHP Tips – Matt Curry (good and free :-))
Refactoring Legacy Applications Using CakePHP – Chris Hartjes (not read yet)
Practical CakePHP Projects – Kai Chan, John Omokore & Richard Miller (not so usefull)

CakePHP is the best solution with a small learning curve.

I was in your shoes just 2 years ago. I personally chose to use Zend Framework. It's important to understand that ZF is built by the same guys who maintain and improve PHP itself! Just that gives it a lot more credibility.
When choosing a framework you should consider the following:
Size and Quality of the community - Being one of the most widely adopted PHP frameworks, Zend Framework (aka ZF) has the biggest PHP framework community; hence, most of the problems you will encounter will have already been answered. There are frameworks out there that are supported by just a few developers and if they happen to quit working on it, you're stuck with the latest version of the framework. This not likely to happen with ZF.
Documentation and Beginner Friendly - The ZF docs are pretty good, full of examples and beginner friendly. There's also a ton of tutorials and [quick start guides][2]. It's extremely easy to start up a new ZF app.
Investment - Sure you have to invest sometime learning how it works, but everything's like that in the software engineering world. You have to understand [OOP][3] and [MVC][4] before hand as well. Many people don't understand that using a framework to develop procedural-like code (instead of OOP) is defeating the purpose of... using a MVC/OOP framework! Therefore, it's important to grasp and master these concepts so you develop the best code possible. And by best code I mean
a) code that works
b) code that's easy and fast to understand and maintain.
This investment is well worth it since it will drastically increase
a) speed of development
b) speed of debugging and maintenance.
Also, take advantage of this moment in your programming career to also adhere to other common best practices (if you haven't already done so) by using:
a) Unit Tests - incredibly easy to integrate within ZF. Look into [Test Driven Development][5] as well.
b) An IDE - VIM, [Netbeans][6], etc
c) [Design Patterns][7]
d) Source Control - [Mercurial][8], Git, SVN, etc
e) Finally, keep yourself in the loop by [following what's going on the PHP world][9].
You'll thank yourself yourself in your near future! I know I did.

As no-one has voted for Symfony here i will and here's why. There are two types of frameworks, well a whole range actually but in the PHP/MVC area which is where we are in this thread there are Glue and Full Stack frameworks.
Zend and CodeIgniter are Glue and Symfony and Cake are FullStack.
Glue are the ones where you can pick and choose which components you can use and how much "standard" code you can use. These tend to have a gentler learning curve as you can pick the bits you like that help and fill in the more difficult bits with code you know.
FullStack means you need to use the lot and so the learning curve can be quite steep. Also with FullStack there can be a tendency to balk against the way something is implemented rather than just accept and flow with it.
Coming from a write everything myself background i initially favoured the Glue's but have now migrated to FullStack using Symfony 1.4 and 2 and Sinatra and Padrino. The extra speed and power the fullstacks give is not something i would like to give up.
One downside of CI is that it is built for php4 compatibility and so does suffer in a number of structural ways when you come to push the framework, Kohana is a fork that addresses this issue. And i dislike Zend because there are so many ways of doing the same thing that after a while the Framework seems almost irrelevant (Sorry personal rant)
At the end of the day use of a Framework is good because it adds a structure and can be a great aid to learning and the one to choose is the one you feel comfortable and are productive in.

There are many frameworks and several really cool frameworks.
After trying so many of them I think you should not start using any of them before finding best suitable to your needs.
You may find any other after choosing one so do not act quickly before choosing right one.
Before creating an application with a framework you should make exercises.
For me I started with CodeIgniter created one application and left second one in the middle, then passed to Kohana and started second application according to the needs.

CodeIgniter is the one that I prefer

The framework must have little learning and easy to expand. I am using http://sourceforge.net/projects/naanalframework/ for all my projects. There is no installation. Just has to point the frameworks naanal.php in your application's index.php and run it. The framework will guide you what to do. For the beginer, this framework is very useful to develop PHP applications. A sample application also available at http://sourceforge.net/projects/naanalframework/files/sample%20applications/wordpress_plugin_builder.zip/download

Related

When to go with traditional Java stack (Struts2/SpringMVC) vs modern JS stack (AngularJS, NodeJS etc) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
We need to implement a one-form app (long form) that persists into Oracle DB. There are no Web services of any kind. The culture is traditionally Java-oriented here but it's open for suggestions.
What are the Pros and Cons of going with:
The traditional MVC Java stack - Spring, Struts2 or SpringMvC, Hibernate
The JS (modern) stack - AngularJS, NodeJS, ReactJS
Any clear explanation of the differences, with the Pros and Cons, would be strongly appreciated.
As I stated, I haven't been able to find a reasonable and understandable comparison.
It's apples and oranges. I'm only posting this as an answer because it outgrew the comment.
First to nitpick a bit, AngularJS is front-end technology, you can use it with any back-end technology (I use it with Struts2). So lets remove that from the comparison.
Second nitpick your comparison is more a JS vs Java choice. If you did your research you could be comparing NodeJS against Play, Vert.x, or similar. Not because those frameworks are "modern" but because they share some of design goals which made NodeJS what it is (Vert.x is very similar in intention, it has comparable speed, non-blocking design, and allows for polyglot programming).
But really there is something more fundamental than the frameworks... and that is the language. If you know JS and you've worked on the front end design did a mockup and then need to develop server side services and aren't more comfortable with another language, well it really doesn't make sense to invest in that heavy lifting when you can start doing something useful right away. It's also the same the other way (from the Java perspective) no matter what the framework you need to invest time, if you already know a Java web framework, why waste your time figuring out something else?
That last question isn't rhetorical, seriously why waste your time? In defence of keeping with JS, you can keep everything in one language, NodeJS is pretty fast, although keeping the comparison fair there are many Java web frameworks Struts2/SpringMVC don't have similar design goals to NodeJS while Play, Vert.x, and I'm sure there are others would be a more fair comparison. JS has a different way of doing things and if you have JS ninjas then it does make sense to do everything that way. As for why Java, it is fast, it has an enormous codebase, there are APIs and frameworks for everything, from meta programming, AI, robotics, security, obviously databases and everything common, there is enormous choice. It is more structured, in the end this means that months later you can generally figure out what you were doing and you can better share work and divisions of labour. But again, does any of that matter? I'm not looking to start an argument with the general public, only you know your requirements. Consider them and also consider human nature and take a reasonable course.
In my experience people use what they know, people I find are often splitting hairs over their favourite framework and someone else's for no other reason that that is what they know. If you're going to use some technical tooling advantage to try an get consensus that is highly unlikely to happen, and I would recommend first to look at your human resource capabilities; I mean you could write it in Java or JS, whatever but happy employees will produce way more regardless! What the majority would rather work with can't be discounted lightly.
This is not a question which stack you use. Pros and cons have nothing with the technology involved rather than humiliating the user experience by choosing one framework over another.
If you get any project from an idea to the production software you should know that many many, many factors apply on making decision on the architecture of the project. All it depends on the proposal that you should write first. The quality of this document will make influence on the further decisions and directions, feed-backs from the end user who is the consumer of the desired product.
No language, no framework, no programmer needed to provide you the user requirements. It's just the software that should do some things. That's all you need to know at the first time.
You can promise the user that you can build the software that is required, but you don't tell how it would be built, which language you use, framework, technology, resources.
You can see what other people is created and how it works and if it fits with what user is required then you luckily copy/paste. Unfortunately, it doesn't work in most cases and you have to pay for every brick in the building.
The most significant part over technology is programming resources. If you have such resources that you already tied a half which technology is preferred to use with the project. Technologies, languages, frameworks are different, and nobody can handle them all with expert level. You can build the software with one framework, then rebuild it from scratch with another and then you can compare. If you can't compare the costs used to build the software than your decision is just opinion based on other opinions.
The pro-vision occurred if you have experience of building production software on different platforms using different languages and different frameworks. Because many languages, frameworks are in most business problem oriented and recommended to use by experts as suitable to solve such kind of problems. There's no any point which one is better, because if you choose one that is more recommended than others and create ugly software using it you can't say that it's worse that others that are less recommended. On the other hand if you choose framework and create the great software that may be lacks some features available in other frameworks you'll win.
Don't play with the technology, use qualified consulting services. This is out of the topics of stackoverflow. Because this information is always commercial. Good luck with your endeavors to find the better software that suits your needs.

How to understand the differences of Web Frameworks, Databases, and Libraries?

Where I stand: I am a junior in college. I have a solid background in Java and C++. I've been coding websites in JavaScript, HTML, CSS, and PHP (using MySql databases) since middle school. I have only just uncovered the magical box filled with these mysterious "frameworks."
My Predicament: After reading in my spare time wikis, blogs, and StackOverflow questions week after week for the past few months, I feel that I am no closer to understanding the items in this ominous list and how they relate to one another.
Yeoman, Grunt, Linemanjs, Bower
Nodejs, Go, PHP
Mongodb, Couchdb, MySql
Angularjs, Ember, Backbone
Terms like: boilerplate, scaffolding, frameworks, etc...
What I am asking: I understand that explaining any one of the above would be a question too big for a single Stack Overflow question, but that's not what I'm looking for. What I am looking for is a guide that explains in-depth what each of these groups are used for and if/how they can be combined (ex: using Angularjs with Nodejs). I am happy with a link if an article already exists, but I have yet to find an article that covers all of the above.
El Fin: I love learning new languages (especially for the web), but right now I feel like I'm blinded, running around in circles like a chicken with its head cut off. A shove in the right direction would be great :)
I'll put this in as an answer to help clarify why this is too broad.
I think that the GREAT BIG point you are missing is that there are specific reasons someone chooses a particular framework or server environment when they start a project.
This is all dependent of a boatload of things that like budget, knowledge, availability, expected scope of the project, etc... It also may come down to, "I'm starting this new project, what is available in this work environment for me to use?"
Then you don't really get to choose. You get what you get.
So what's the best package of technologies to use? That SO depends on what you're doing.
Example: If you are building a simple site for a local store that just needs a few pages, and you want to keep your costs low. A simple LAMP solution would work fine. But if you want to design the next Facebook, even though the core of the system could be build using all LAMP (and it in fact IS), you will need MUCH more powerful servers, and MUCH better and more efficient coding. Not to mention a boatload of server space for both the site AND the database.
In many cases, when you see people pooling together what might be considered obscure technologies, all they really break down to are collections of libraries. It's like choosing JQuery over some other JS library that essentially does the same thing. One may be better than the other. But you go with what you are comfortable with.
So, when you are asking about how, why, and in which way, do people combine technologies together, there is no way to answer that at all. Other than to say, it's specific to their needs. And that's about it.
Reading articles that compare all these different things together will only give you an idea of what they are capable of, and what their limitations are. In the end, it's always a matter of opinion what is better. Otherwise we would all be coding with the same thing.
For my part, I prefer PHP over ASP. I prefer working straight out of a text editor than using an IDE or any MVC framework. I use jQuery where it's needed, but don't over use it.
But that's just me.
And I'm sure this still didn't answer your question.

Agile Toolkit, worth using?

I'm considering using the Agile Toolkit, ATK4 to upgrade a number of web projects that I'm working on. I really like the idea/paradigm that the Agile Toolkit presents, but I'm worried about documentation.
The agile website's documentation is sparse, in broken English, and seems to 'paraphrase' the symfony documentation.
The agile toolkit alleges to have been in development/production since 1999, yet there are only a handful of StackOverflow.com posts regarding agile, and next to nothing comes up in Google searches...
In short is it worth spending time learning the Agile toolkit, or would my time be better spent on a framework that has more of an active support community? I've tried a few other frameworks, but ATK's implementation really stands out...
Initially ATK was born as an internal tool from Agile Technologies (.ie) so that has been conceived in 1999 but it was recently launched as dual licensed framework.
That's why it lacks some documentation and has not a huge community nor appears Googling.
I was amazed at first sight by its working way proposal so that I engaged it. The documentation has been already improved and over the time it will keep getting better and community will grow.
I had the chance to get in touch with the lead developer and trust me, it will get better and better.
Even, as an example all the ATK4's site is developed with the toolkit and the code is short and pretty easy to read.
Good luck!
ATK4 does have many examples, and code is concise and clear. It accomplishes the goal of wrapping server-side and client-side into one comprehensive framework via php. Plus it looks nice. It does appear that documentation is improving.
Yep - agree with what the others are saying - Romans is doing a great job of getting the documentation updated. I started writing an application in straight php but realised i was going to need to use jquery to get a nice, cross browser compatible front end and wanted a php framework that would support that.
I looked at Yii, Cake and CodeIgniter but ATK4 really seems to do what i wanted. Like anything, it takes a bit of getting used to and i'm still relatively new to both php and ATK4 but i've rewritten what i already had for my application in the framework and the code is so clean - all the html and css are separate and the page code is really compact. The integration with Jquery is great and i've just written a plugin that i needed to get jqplot working for nice looking graphs.

MS SQL and my need for a little direction [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I've been lurking around for several weeks and have been totally blown away by the amount of information and how the community quickly responds. I have noticed that questions like this typically receive sarcastic remarks and sometimes get down voted. Please bear with me as I attempt my first post :)
I little background..
I work at a tiny software company as the "QA department". Our application has a MS SQL back to store customer data and short term loan information for financial service companies. I started working here 6 years ago as a gernal technician to provide support for their call center, so I've been overly exposed to SQL and have become fairly familiar with working with it. You probably wouldn't pay me to develop a enterprise level database, but at this point I've become familiar enough to do most things in SQL.
Why I'm asking my question..
I want to develop an application to store and track our software issues and new dev. I've done research on this website along with asking around and I still feel sort of lost as to which direction I should take. I want the core of the application to be pretty basic at first, to provide various screens between my entities/modules and to create reports to show their various relationships. In the future I want it to be more complex, to provide a web portal of some sort and to start getting into various complex QA software concepts. I've read around and it sounds like I might want some variation of C/VB for the windows portion, but all of the topics have sort of overwhelmed me. Do I want to start with a more basic one that was created 20 or 30 years ago? (I think that's C and C++, right?) or a more recent one like C#? Will I be able to develop a web portal with both of these? (by web portal I'm thinking it would provide access to our database of defects and have username/password sign-in). I've seen that the various .NET languages lean more towards web development, should I start with one of these?
I am at the very beginning of this and I fully understand that I'm jumping into some deep waters here. I want to make sure I don't end up spinning my wheels and that I focus my energy on something that won't end up being a bad idea in 1 or 2 years after I start. So far I've found this website very helpful, if I can pick a direction I know I won't have any problems finding what the next step is. It might help to know that I have no formal or informal programming background (if it wasn't obvious). I'm a 27yo techie who is starting his first venture into programming, go easy on me! Thanks for taking the time to read this :)
I won't recommend that you go to C, C++, or VB. C and C++ are used mainly for developement of system software, compilers, etc. VB is deprecated by now; there is a .net version VB.NET, but my preference is C#.
Looks like you are a Microsoft shop. Steer youself towards using C#. Visual Studio provides great support for development of Web Applications with support for holding state in entities backed by MS SQL.
I would start with a simple example as given in MSDN http://msdn.microsoft.com/en-us/library/dd410597.aspx.
This example uses an Model View Controller based framework that is fairly easy to configure and use. They have great examples.
There is a free framework that also supports MS SQL Entity store http://www.coderun.com/ide/
Enjoy
Don't write a line of code. There are literally hundreds of open source and commercial software packages that already do what you want to do. You'd be better of spending time researching them and finding the package that most closely meets your requirements. A good solution will also be extensible enough that you'll be able to modify it to meet all of your requirements.
Since you work for a small company I can guarantee you that using your limited development hours "writing your own" will be counterproductive. You'd be better off adopting something off the shelf and becoming proficient at it. You'll learn more about developing systems like this once you've become intimately familiar with one of them.
Check out JIRA or
http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems for some other ideas.
For the benefit of your company I would recommend to use an existing
solution. But if you want to learn and build something of your own, I
would suggest that you check out some popular web application
frameworks, like:
Django
Ruby On Rails
Zend
Good Luck with your project!
Given that your intent is to learn and create something yourself I think you should consider a LAMP stack and PHP with one of the PHP frameworks on top (Cake PHP, code-igniter or the like).
The C++ route is a long hard way (C++ is my language of choice) to learn; as a learning experience I think you will get quicker and more satisfying results with PHP.
I also think that this is a realistic project for someone of your skills over a period of a 6 to 12 months - start with a simple requirement and then build it up to have all the features you need.
If you just want a bug tracking system obviously there are many options that won't demand any development.
How much experience do you have with things like installing Linux, Apache, Mysql, etc? If you are completely new to this, then this will be a much tougher task, because there are many layers you'll have to learn before you can even get to the point of writing an end-to-end application.
I would avoid C/C++/C# because there are a lot of things you would need to learn about basic programming before you even got to the stage where you could make database calls.
On the assumption that you don't have experience with LAMP (Linux/Apache/Mysql/(Perl/Python/PHP)), my suggestion would be to start simply, by using a scripting language like Python or Perl. You can very easily get a database connection, and start writing queries, and extracting data from there. If you are used to Windows, I would install ActivePerl or ActivePython, and start from there. You can start building a command line program that does what you want, and then from there, you can move on to creating a web application that can do something similar.
Building a web application would likely be much easier than writing a Windows application, so after you have gotten comfortable with the scripting language, that's the direction I would go afterwards.
Good luck!

What is better CakePHP or pure PHP for a huge Project?

I just know pure PHP, never worked with a framework before, but my boss wants me to create our next project, which will be a lot bigger than everything we did before (means bigger than a page that needs only 5 scripts to work, more like 100 or something like that).
But I'm not sure if I can realise it with pure PHP, now I heard that CakePHP could be helpful for that (structure etc.).
Should I learn this or just use my pure PHP way?
As noted, your definition of the scope and complexity of this project is a little vague, but I'll respond with the general observation that larger projects benefit from more "top-down" structure than smaller ones. I suspect that pretty much every PHP developer on the planet started by hacking straight into index.php, then wrote some code for guestbook.php, and so on. Then you realise how much you're repeating yourself and start refactoring to classes and libraries.
Frameworks are the natural next step up from that. The term covers quite a range of products; some that tie you very closely to a specific way of working, and some that are more a library with some loose front control.
I'd advise you to choose a loose MVC framework, which gives you a good structure to work within, but doesn't overly constrain you, and should allow you to use existing libraries. I've not used CakePHP - my experience is with Zend Framework, which I like a lot (not that it's flawless). However, I have worked with another developer to compare the functionality of Cake and ZF, and from what I've seen Cake has many of the strong points that ZF displays. In fact, in many places it almost seems you could convert code from one to another by changing a few classnames.
I suspect Cake's not a bad choice at all, but I can't recommend it as I don't know enough about it. ZF I do know, pretty well now, so I can recommend it - and the docs are now pretty good.
Before you dive into either Cake or ZF, you'll need some understanding of the MVC design pattern. Jason Sweat's book is a good, if slightly dated introduction, and the ZF manual is also pretty strong.
By the way, it's not a choice between "Cake and Pure PHP". Cake (and ZF) are both "Pure PHP". The difference is between "PHP I wrote", and "PHP someone else wrote" (so I didn't have to). From this, the important bit is that you trust the quality of that "someone else's code", which in this case you'll have to do by recommendation and reputation.
But don't just go asking "What's the best PHP framework?" - that's like asking for the best text editor ;) And I'm sure this response (or question) will get tagged 'subjective' in mere moments.
I've been using Cake for a couple of years. I'd say if you haven't used any MVC framework before, you should definitely learn one to expand your horizon.
It's not really about using the framework for your convenience. It's about seeing how things are done in the framework-land. You'd really gain some insights that you can carry over even if you later decide not to use a framework.
Your description of the project didn't sound too huge. However, learning an MVC framework is some serious learning curve there. Basically you'll feel like you're learning a whole new programming language. So for your situation if you really do decide to try a framework, you might want to factor that in your schedule.
To get you started, I personally think CakePHP has a more elegant solution and has tighter design philosophies. CodeIgniter, on the other hand, seems more natural to "pure PHP-ist" because it's less abstract so it might be easier to pick up.
To answer the titled question though, I'd think any huge project should roll their own from the start instead of using a framework. The whole point of using a framework is because you want to leverage some of the stuffs they have built in for you. But for really huge projects, many of the parts should be customized anyway, so you might found yourself restricted by the framework more than leveraging it.
But then again, I really don't think your project (by your description) is anything near huge. As a ballpark estimate I'd say any project under 50k - 100k hits a day can safely benefit from using a framework.
I do not say CakePHP. But any framework will do. The major benifit will be you will get a default folder structure, skin, language framework (oscommerce etc. do). You will be customizing this framework. Most features will/may there be by default, like email sending, page creation, Menu generation etc.
You did not say what kind of application you plan (may be because of NDA). More details, more accurate answers.
I agree that it shouldn't be a decision whether to use CakePHP, but whether to use a framework at all. There are a multitude of PHP frameworks out there (Cake, Symfony, Codeigniter, Zend, etc.) and each has it's advantages and disadvantages.
If it was me, I'd use a framework just to strictly enforce some MVC rules... with a large project, keeping things structured helps down the road when someone else inherits the system.
The key here, is don't get lulled in by the "code generation" aspects. If you don't know the framework (or don't know the language as well as you could) down the road, the code generation could be more of a headache than it's worth.
Using a PHP framework like cakephp will reduce the amount of code you need to write. In cakephp there are many things that will save time like using elements to display snippets of code that you use often. If the project is really big, it will help tremendously because your code will be shorter and much more clean and organized. It will be much more easy to maintain as well.
I think that pure php would be the best option because if you use a framework you are restricted to their boundaries,
whereas without framework you are free to design anything, if you think that you have the best capability of solving problems and making algorithms then you must go with php not any kind of framework
and if you just want work to be done then you must go with framework i haven't worked on framework by have some knowledge of cake php i didn't liked it as i think i am tied with some rules, i prefer writing my own code and in case you want to do less work in future just write you own rules (its like making your own framework) just save every thing you created in small files and then use them in you other project just like one of the benefit of OOP(Object Oriented Programing)
If you know PHP, you'll learn more about how to implement common design patters if you start reading other peoples code. The more you read, the more you'll get perspective on what good code looks like, and what bad code looks like.
It is tempting to "code-your-own" because you will understand it more fully, but remember, you're not going to be the only one working on this, and one day, you might actually want to work on something else, and having a system which is widely implemented and understood can make it easier to move on.
As far as whether cakePHP a good choice for your particular project, it's hard to say without knowing more than it's going to be "bigger".
Everything depends on the project and the project stake holder. If there is going to be a lot of modification, either during development or after the project goes live, a framework can be pretty limiting to someone without a strong grasp of the theories behind the framework (not a judgement on the programmer, just a statement.)

Resources