Is the Zend Framework similar in use in relation to PHP just like jQuery is used for javascript?
Only in the sense that thing A is written in thing B and attempts to make doing things C, D, and E easier for programmers using thing B.
Programmers have been writing libraries of code for their favourite language for decades. It's called 'not re-inventing the wheel' and is a Good Thing.
In this case you are talking about two different wheels. On two different types of transportation vehicle.
Zend is an MVC (model view controller) framework that allows you to build applications in php following that particular design pattern.
jQuery is a library that lets you do lot of stuff with the DOM and simplify javascript/DOM/ajax coding.
My answer is no :)
i think Following notes can help you::
Framework is collection of libraries which have software help, Many code libraries,scripting languages, Support programs etc..
But libraries is simple collection Of methods!!!
Not exactly. Zend Framework is framework and jQuery is library. Read here about difference between framework and library.
I'd say that jQuery is what CakePHP is for PHP and Zend Framework is what DOJO is for Javascript.
jQuery helps you with simple tasks, but is discutable for enterprise usage for the lack of systematic classes. It's more of the quick 'n dirty solution. It's faster in simple tasks, but for complex application it meets it's boundaries. It lacks comprehensive extensions loading mechanism AFAIK.
Related
I have completed my website couple months ago, in php 5 (full oop), and now I'm think of migrating into PHP framework (Zend looks fine).
My question is, how hard is it to migrate from oop to any php framework?
What is the easiest Framework i can migrate to?
Noting that Functionality of my website depends on:
A lot of MySQL Searching and Updating.
There is a lot of forms in the web, some of them can reach more than 50+ fields.
A lot of classes that handle logic of website specially analyze submitted forms with data on database.
I have no experience with php frameworks, so can you please tell me which framework would be least painful to move all my classes there and get them running fast?
How hard is to migrate... is a good questions...
A little example:
You can write your own queries... You can write queries in a "ZF-like" style...
then if your OOP Classes are well formed (I mean well formed for use them into the ZF enviroment) your migration will be quick and easy...
but you also have to understand ZF Mechanics
Keep a look to those beast:
- Zend Forms
- Zend Decorators
IMHO the two beast of ZF
If you switch to ZendFrame work you need to convert
your sql queries using Zend Db
You need to convert your forms into Zend Forms.
Zend provides classes for form validation. So you need use Zend Validation Classes for the form validation.
The question is like
How long is a piece of a string?
We don't know your application, the information you gave us is too vague and we don't know your experience in php at all. Porting code from one architecture to another can be easy (if the basic styles and techniques are the same) or pretty impossible (if you wrote a spaghetti application).
Also the question for the best framework to port to is impossible to answer, as long as we don't know your application.
The main question is: Do your application make use of design patterns (and do you understand them fully),or is "OOP" just the use of classes instead of functions, for you?
I'm planning on creating a small framework for a dynamic site. When creating a framework is there a standard or code of conduct which should I conclude ?
Other than a license for use, there is no standard documentation you are required to include. As for how to build the framework, as you are writing the lowest level components of the code, you get to decide how the files are built and used. Just create some PHP files and allow people to use them.
Taking a look at how existing frameworks are structured is a good way to get started. CodeIgniter is nicely commented and simple enough to understand, so that would be a good project to read through to get started.
Decide whether you framework is loosely-coupled or full-flowed MVC framework
Loosely-coupled framework is util/library based like Zend/Symfony, where you just provide all the classes and interfaces that a developer can use but you do not force a specific request-response flow.
Full-flowed provides and usually forces the developer to use the request flow that it has established, like CakePHP, CodeIgniter or Kohana.
p/s: sorry I don't know the actual terms for the framework categories.
Decide whether your framework is general purpose or targetted to specific use
General purpose is like Zend/Symfony/CakePHP where the framework is not designed with specific use in mind but rather to create a website/application. Specific use framework is like e-commerce, CMS or blog where it is designed to create a website for a very specific purpose.
You can have a look at coding standards, as well as designpatterns (especially the MVC pattern).
Here's a good tutorial which should get you started building your own PHP framework.
A good practice is to look at other PHP frameworks like:
Zend Framework
Code Igniter
Yii
Symphony
...
See list here for more PHP frameworks.
There is no standard per se. Usually you would roll out your own framework - or any product really - to combat an existing problem that persists within all of the existing frameworks. However, if it is purely for educational purposes, I would suggest you build a framework around the problems you envisage you will have.
There is some good advice regarding PHP standards here: http://www.phptherightway.com. The site advises style recommendations known as PSR-0, PSR-1, et al.
I'm a .net developer by trade but I'm looking to expand to PHP. I really like what I've seen PHP can do. However I have been somewhat spoiled with data access in .net (such as LINQ) and how easy it is to make strongly type datasets. Are there such ways to do the same (or similar ) thinks for data access in PHP? A framework I'm unaware of perhaps?
I'm currently planning using a PHP Framework such as CodeIgnitor, jQuery for JavaScript, and possibly a CSS Framework for my next project. I'm very excited to learn something new but when I think of data access in PHP I hit a wall.
Thanks for your input!
I am also a .NET Developer spoiled with LINQ, I've been using CodeIgniter for a small project and I've been very pleased.
You can take a look at Active Record on Code Igniter
http://codeigniter.com/user_guide/database/active_record.html
Most frameworks you come across are going to have some kind of data pattern - DAO, Active Record, etc. So that should suit your needs if you plan on adopting one from the start.
I am not entirely familiar with .NET and LINQ. But PHP does have some native DB libraries as well as PEAR libraries (PDO) that serve as good wrappers.
Pattern and Practice yourself with MVC for PHP ... this will give you the closest adaptation to ASP.NET C# DataSet - Also, be wary of the classes/object handling in PHP as they are definately not the same.
The Doctrine ORM is hugely popular, and is integrated my favorite PHP framework Symfony.
PHP doesn't have the same kind of type safety that you've come to enjoy with .NET -- and there is not, as far as I know of, anything that works quite like LINQ available for PHP (a little searching pointed me to PHPLINQ, but it doesn't do everything LINQ does). There are however, several good ORMs available for PHP that will give you object-oriented access to your database tables.
http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#PHP
Axon ORM is bundled with the PHP Fat-Free Framework.
As far as I know, many PHP frameworks use syntactic sugar to provide illusion of real functions. Some provide scaffolding/skeleton generation, which is limited. Syntactic sugar is slow and IDE/editors do not provide intellisense for Syntactic sugar functions/methods and member data. I'm wondering if there any tool/framework to generate PHP code based on some popular frameworks and built around a relational schema? Thanks in advance.
I think Symfony has something that you might find interesting.
Try Zend Framework.
Zend Framework (ZF) is an open source, object-oriented web application framework implemented in PHP 5 and licensed under the New BSD License.
I found QCodo http://www.qcodo.com/wiki/article/background/metaprogramming which satisfies requirements. Thank you very much for participating. You all earned my vote.
Zend_Framework has code generator called Zend_Tool, tough it's still unstable.
Zend_CodeGenerator
For posterity, I thought I would mention the rather impressive solution I just found to this problem.
Zend_CodeGenerator was added to Zend Framework as of, I believe, version 1.8, and I'm very impressed with it so far. Like most ZF components, it works just fine as a standalone tool; you needn't implement the rest of the framework in your project.
So far it seems easy to use and quite powerful.
Have a look at Cygnite Framework's Crud generator. It is very simple and easy to use. The New Cool Kid build on Symfony2 console component, I found interesting, made my job simple and fast.
Cygnite CLI generates controller, model, views, layout, form component, required field validation, pagination etc. with a simple command.
php cygnite generate:crud controller_name table_name database_name
You may alter the code based on your need.
Have a look, may help someone.
Generate CRUD application within 2 minute
Cygnite Framework Code Generator
I'm looking for a good framework for PHP and see most offer the MVC approach, are there any other (or better) design methods/approaches that would be considered more efficient or best practice? MVC is starting to look dated but I wanted to know if it's still considered the industry standard.
MVC is still the industry standard for every Object Oriented web development language.
However you are afforded some alternate routes:
Micro Frameworks (Google Them) (which most often still use MVC design patters, just not as formalized and some not in an Object Oriented fashion)
Event-Based Frameworks (like PRADO)
However beyond those routes you are a bit out of luck as far as I know.
Thanks Xeoncross, forgot to add the "micro usually are still mvc" caveat
Well, in all truth MVC is actully misleading when it comes to most frameworks. I don't know of any PHP system that is only based on Models, Views, & Controllers. Most of them also use functions, libraries, configs, and caching levels as well.
MVC is merely a starting point stating that abstraction of your CRUD from your business logic and views is good a good thing! From there you can abstract as much more of the system as you want from template parsers to libraries that calculate physics.
I would recommend symfony framework as my ideal ;)
http://www.symfony-project.org/
The only PHP frameworks that I am aware of that are well tested use the MVC pattern however there has been some web based frameworks that use the Naked Objects pattern for other languages like Java.
In case you are interested it looks like there is at least one Naked Object framework under way for PHP also here:
Naked object PHP blog