PHP, Zend Framework, Wordpress, need to find some clarity - php

First off, I'm new to web development. I am fairly comfortable with HTML/CSS, and I am building my first site for a friend's business. I want to include a contact form, so I downloaded one from CodeCanyon. It is perfectly fine, but I'm in this to learn how to do this, so I scrapped the downloaded form and set out to learn some PHP. (I realize that later on, from a profitability standpoint, it may be a wiser decision to use these types of plugins rather than doing it all myself; would love opinions on this as well).
I learnt how to write a simple e-mail contact form from some tutorials online, but quickly found there's much more to it when you get into address validation, and preventing spammers from hijacking your form, etc. Should I continue to try to learn how to do the whole thing myself? If so, What is the best resource available?
I noticed people saying great things about Zend framework. Can someone explain what it is in simple terms?
Also, I haven't used Wordpress yet, but it seems the best use of this (aside from using it to create quick websites on the cheap) is as a CMS so your clients can update their content later. Does Zend framework also have some kind of CMS element to it?
I know this is kind of a complicated series of questions, but I'm trying to get some clarity. To those of you who have been at this a while, all the different products, languages, acronyms, etc. may seem like a piece of cake, but to a newbie like me, its hard to figure it all out without some kind of sounding board.

Kind of an open question but:
Zend Framework is a set of libraries that help you create php applications. They have a set of predefined classes that simplify tasks like Access Control List (User Login and such) or access Google APIs (like calendar and email). To take advantage of those libraries you need to interact with them in the programing level. (that is, you need to know how to program in PHP and how to access those classes). Here's an example:
require_once('Loader/autoloader.php');
$acl = new Zend_Acl();
$acl->add(new Zend_Acl_Resource('view'));
$acl->add(new Zend_Acl_Resource('edit'));
$acl->allow('guest', null, 'view');
$acl->allow('editor', array('view', 'edit'));
This creates a User Role named guest and editor, and gives permissions accordingly.
Wordpress is a CMS (like joomla and Drupal, for instance). You don't need any PHP knowledge to create a site with these tools and you interact with the modules in the admin level. You can actually integrate Zend Framework (or any other framework) with those CMS, but then again you need not only knowledge in PHP but also in the framework itself and in the structure of the CMS.
To summarize, PHP is powerful yet relatively easy programming language. Should you decide to learn it, you should start by doing some basic tutorials like this one to familiarize yourself with the language. The learning curve might be a little steep but it pays off. Once you feel you can do most tasks, you can try to work with a framework (ZEND or SYMFONY, for instance)
If your only objective is just to build sites easily and quickly, you should use a CMS.

Related

Custom PHP vs PHP and Joomla

What's the best way to build a new social media site that will be sold B2B? My company is a b2b social media company. We've Been trying to determine if we should build from scratch or leverage Joomla.
We have 3 months before our first customers will deploy.
We have received lots of varying suggestions, it seems to be a "religious" debate.
Our platforms contains both standard as well as unique features. It is critical the themeing can be quickly and easily changed regularly. It is a SaaS.
Users will not be extremely savvy, there for the UI must be intuitive, simple and easy to use.
So, is it JOOMLA and PHP? or PHP from scratch?
3 months? Unless you have a VERY capable team that can crank out bugfree code, you're building on something else. Like syrion mentioned, coding a good CMS is not as easy as it seems. Sure, anyone could put something basic together in couple of days or ever a few hours with the right framework, but doing it right and making it scalable is a whole different story.
Joomla has its issues as does every other open source project out there. However, Joomla also has 2 very important advantages when it comes to SaaS - first, the admin is fairly easy to understand for non-tech people. Not quite as simple as Wordpress, but much more powerful. Much easier to teach than Drupal, your clients will not need to grok nodes or taxonomy. Second, Joomla was written specifically to be extended. templating is a breeze as is extension development. Their MVC is a little different but not hard to grasp. If you have decent programmers they will be able to make Joomla do anything.
Please dear god if you have the choice, don't start from Joomla. You will be much better served by picking a framework like CakePHP, Symfony or CodeIgniter. The MVC model in Joomla is essentially wrong (views pull directly from the database? yuck) and there is so much legacy code and simply bad code that your developers will end up throwing out and rewriting most of what Joomla comes with. I should know, that's what I have been doing for the past few months at work.
Joomla bundled with community builder is a viable option.

When should I use a CMS over creating a website from scratch?

Lately I've been trying to learn ASP.NET. I've gone through the tutorials on the ASP.NET website, but for the most part I'm a complete beginner. I've also been working on creating a personal website, which I've opted to use the CMS Umbraco because it is based on ASP.NET.
Now my questions is not really specific to ASP or Umbraco. It could apply to PHP and Drupal or any other website framework and CMS. I'd like to know when and why a website should be created using an existing CMS technology (Umbraco, Drupal etc..), and when a website should be created from "scratch" using a base web application framework like ASP.NET, PHP, JSP etc..
It depends heavily on the CMS's (module/theme) API, for instance, one Drupal modularity in my opinion is its greatest strength, although learning Drupal itself is not to be taken lightly either. I've seen a lot of commercial sites done in Drupal, most of them look successful, but it made me think what was the total cost of creating the modules, customizing it, etc.
Since you mention you are a newbie in this stuff, do take in account all the stuff to take care of when you are creating a website from the scracth:
Security (XSS prevention, sql injection, blah blah)
Authentication
A flexible theme system (unless you mix html with code... good luck, although there are some really nice template system available for PHP 5)
Database Layer (just use an ORM)
Learning JavaScript, then learn jQuery, MooTools, etc.
Administration panel
Adding stuff like content management
But most importantly, plan something before doing it. Starting out just because you feel like without planning what you want and how will you implement it creates uncertainty, just too many doubts...
So start with a CMS, even for a personal site. There are solutions like Joomla! Drupal, SimpleCMS, some django CMS are also out there. Learn the language of the CMS and start creating your own module as you see fit. Always read their documentation, search in forums before asking, or search here in stackoverflow. Really.. just ask here.. better than googling for a solution :P
You should use a CMS because it's simpler. There are a lot of 'boilerplate' code that you don't need to rewrite. Some CMSes might also contain useful code like user authentication built in. You won't have to roll it your own way, saving time and if you aren't a good programmer, it might also be more secure. Not only that, using a popular CMS means you'll also have a bunch of modules that you can just plug in and use. You can now focus more on the design than the programming in less time.
When should you not use a CMS? If a CMS doesn't provide anything you need or it doesn't allow you to do what you envisioned.
First of all it depends on whether you intend to build a real-world professional website for commercial purpose. If you do, I have to tell you it takes at least 2 years full time self-study to be able to write a web site like that. Web development is not as simple as it's made out to be (Some ppl say you could manage ASP.Net in 3 months-that's due to ignorance). Not only that, it is extremely logically challenging.
So if you only intend to write one professional web site, the best choice would be to pay someone to do it. You only learn ASP.Net when you intend have have a career.
CMS website would be enough for personal website, but maybe not professional enough for "tasteful" commercial websites. Its looks and functions all look the same, maybe good enough for local appliance repairs shop, but not good enough if you want to show your business have "taste", which also implies money
The most important feature of the CMS is its simplicity and the management of data.This is why my big sites like stanford, whitehouse etc have their sites on CMS.Managing the data is not an easy task as it seems.
For me at least it would be better to at least try to create something from scratch I know that they're plenty CMS out there that make things easier but, again ... for me the best way of learning is doing things your self and discover and solve real issues rather than just read about them. if its something for you own and you can afford the developing, troubleshooting testing.. blah blah... do it your self, if its something for a client and you you have a due date I would rather use a CMS or if you want something between a framework such Cake PHP or Codeigniter.

CMS or Framework?

I'm looking to build a online store. However, the first question, past the idea of the store, is the platform. I've previously worked with Java and PHP and am quite comfortable with PHP. So my first considerations were Drupal or maybe CodeIgniter (which I have heard lots of good things about)
On discussions with friends, they suggested Django. But I have no experience with Python or Django.
So my question is, is CI better or Drupal? And further, if not either of them, is Django better in terms of ease of development and extensibility?
Request you to not make this a php vs python battle as I'm looking for advice here. Thanks
Edit: More information about the project:
The Project is intended to create a web-store for certain products which aren't currently sold online. The store will have high-resolution images of the products and other associated details. A few other special features related to the products will be added on in time so they aren't that important.
Another clarification: I understand that Drupal is a CMS and not a framework per so. The only reason I compared it to CI was due to the base platform - php. Perhaps the better comparison would have been Joomla vs Django (but I'm not sure as I do not know enough about either, yet)
Choosing a framework for a project you already know what will be the purpose will only slow your development down. If your project's main goal is to be an online store, then pick your choice among the many projects already implemented for you with payment gateways, shipping options, product management, etc. A framework may offer all that too, but will not be ready-to-use out of the box and you will have to bind everything together yourself. My personal opinion is that frameworks are good candidate when you need an highly customized web application that you will write from scratch, that will not only do e-Commerce but handle other specific business models too.
General purpose CMS such as Drupal, WordPress, etc. are good if you plan to extend your online store to also offer other options (i.g. forums, blogs, multimedia/interactive contents, etc.) If you choose to pick this avenue, I would suggest you download the source code of each CMS you retain and play with it for a while and pick the one you feel the most comfortable with, and which has a good user community. Because there's nothing worst than being stuck with someone else's broken code with no one to help you out.
For e-Commerce solutions, you can find many good projects here. If I may choose one to suggest, a solution that you may consider as it looks simple, it is written in PHP and has good reviews is OpenCart
A good one I have worked with is the Instinct e-Commerce plugin for WordPress. I don't necessarily like WordPress, but that plugin is fairly good and will have you get your online store up and running in no time. The plugin also enable you to code new custom payment gateways fairly easily (just one file to code...)
CI and Django are frameworks that help you build a web application from scratch, if you are willing to do this - go ahead and try it. There should be plenty of modules available that allow you to easily extend the framework.
Drupal however is a CMS, so it comes with multiple plugins already installed and is able to manage your content. You'd still need to develop the "store" functionality - payment, listings, etc. - yourself.
If the CMS fits you perfectly now and in the future then CMS, otherwise framework. The framework will allow you total liberty for the price of time spent on development
Have you read and heard about JOOMLA i think its very poweful CMS in php and has a lot of community support as well, In java LifeRay is a good option.
I'd only use a framework if the requirements can not be engineered into an existing cart CMS.
I'd use a CMS over a shopping cart if the commerce aspect was relatively trivial
I'm surprised you're not considering an off the shelf cart. Open Cart is pretty extensible, and Trading Eye has a nice CMS component.
I would generally advise to stick with a language you know for important projects, although I like Python as a language much more than PHP, and Django is a nice framework.
Drupal is not only a framwork, but also a CMS. You can build an online store with some modules (Ubercart), so I would recommend to try that and see if the stock solution fits to your needs.
I suggest you have a look at Drupal's repository of modules -- in particular those in the e-commerce group here: http://drupal.org/project/modules?filters=tid:104&solrsort=sis_project_release_usage%20desc
There's a ton of them that could really help to speed you along on this project.
If you know PHP and have a good grasp of HTML/CSS/JS, you should do OK in Drupal too.
Choose Django if you want to learn Python/Django and use them in your future projects. Django is cool and you'll have fun learning Python. And you'll be able to make an informed decision for your next project.
However, if you have a budget/timeframe or just want to make this project out of the door without needing to learn a new framework I'd suggest choosing a tool/language you're familiar with.
The Bricksett CMS will build the website for you but you can also modify it using PHP for additional functionality. Modify its CSS for a better look and feel. The layout is also simple yet it has a design distinct from other CMS.
A new addition to open-source CMS
Yahoo has something like a specialized CMS for online stores, called Yahoo Stores. They make it very easy to set up an online store, and provide other logistical services. You may want to take a look at that. Of course, they take a small percentage from your sales.

Integrating a user-facing PHP framework and an admin-facing PHP CMS

My company is looking at various PHP frameworks to build a customer's site. This is a shop that has some legacy in-house frameworks and we're trying to move away from that. In my spare time, I've coded in CodeIgniter and dabbled a bit in Kohana. I have yet to use a CMS like Joomla or Drupal, but I recognize that they're built using an MVC and PAC design pattern respectively. In starting my excavation, I came to the preliminary conclusion that it might make more sense to use something like CodeIgniter to build the user-facing portion of the site and something like Joomla to build the admin-facing portion of the site, such that Joomla is never loaded unless you specifically go to admin.xxxxx.com.
So following this logic (and please do let me know if it's very flawed), I'm here to ask if anyone's ever done anything like this before, and if so, what might be the best method of taking advantage of some of the more automated features of Joomla (sorry if I don't go into too much detail here...I haven't studied Joomla enough to know everything about it....please correct any gross cognitive errors!!) from within a more lightweight framework like CodeIgniter.
Or is this going down the wrong line of thinking? My first instinct is to just link the two by data in the database and never have them communicate directly, but I just wanted to be sure this was correct before I take it to my superiors.
Vielen dank, guys
Quite possibly flawed, all of these CMS's run on assuming that they are used for both admin and user site, the major problem this causes is that code and the way things work are very intertwined meaning that a simple 'hook in to the database' often isn't enough and you'll have to use most of the CMS code just to pull / put valid data - the other caveat with that is that if the admin is upgraded, it can easily change the database schema which would break your front end.
I'd highly recommend going with one or the other, either your own design using frameworks for admin and user site(s) - or just stick to single CMS and bolt on whatever functionality you need with plugins.
Best!
I Agree with Nathan.
When you're using pre-built frameworks you lack the control factor over the core elements, this is not good especially developing for a corporate system, you need to have full control over every part of the system for future developments / integration.
My advice is to start with a small but abstract system it would be more beneficial, my advice is to use a framework like codeignighter that consists of an MVC Pattern but also plays the simplicity role with ease.
Take a look at the OpenSource application called "OpenCart" which is a small MVC Store, the reason I say look at this is because it's an extremely basic MVC Pattern and can be abstracted for your applications.
Hope this information helps.
Regards.
When your using pre-built frameworks you lack the control factor over the core elements, this is not good especially developing for a corporate system, you need to have full control over every part of the system for future developments / integration.
Well I don't know if i would necessarily agree with you about this?

Should I use Drupal or Kohana-type framework for a web "application"

The debate is that I need a PHP Framework/Drupal with the flexibility to add custom features to a potentially large application (web and with an api).
However, with a framework, like Kohana, I see myself tackling and re-inventing the wheel with the simple stuff like account management and cms stuff. Account management and quick data collection, like fast form creation, are tedious in Kohana but appear incredible simple in Drupal. On the other hand, based on my limited Drupal experience, I doubt building rapid custom "features" and allowing users to create "groups" and to manage their own roles within those groups is something Drupal can easily accomplish.
To simplify, is Drupal capable of true Web Applications; where the application is a service and provides custom results to each user? Can it provide a dashboard-like interface for users to change their settings or preferences? Can it aggregate data from particular users to provide better results/info to others?
If so, please point me to some knowledge :-)
I'll admit right away I'm a big fan of Drupal and I have never used Kohana, so this post will be one-sided.
In the company I work for they use Drupal or Zend Framework for pretty much all projects (Drupal being in the majority). Many ZF-oriented people dislike Drupal as it's structure is so far from the object oriented ZF-stuff, and Drupal is "just an CMS". As I see it Drupal is more of a Framework than "just" a CMS, and the best part being that it is incredibly flexible: everything is possible.
And yes there is indeed a module for everything. To be more specific:
On the other hand, based on my limited Drupal experience, I doubt building rapid custom >"features" and allowing users to create "groups" and to manage their own roles within >those groups is something Drupal can easily accomplish.
I can only guess what you mean with rapid custom features, but imo it's easy to expand Drupal with your own modules. Most features are available as (free, community contributed) modules, and many advanced looking features can be easily created for example with the "views" and "cck"-modules.
http://drupal.org/project/cck
http://drupal.org/project/views
Creating groups:
"organic_groups" ( http://drupal.org/project/og)
"og_user_roles" ( http://drupal.org/project/og_user_roles )
These modules together are what you need to create groups that have group spefic roles (and roles having specific rights). There are probably other ways than using "og_user_roles", but I'm advertising it because I've made a few patches for it a few years ago. The problem is usually a bit too many options.
If you want to extend group specific options you could code your own module, but most likely you don't need to because there already is a module for it. For example, there are at least 120 modules that integrate somehow with the "organic_groups"-module:
http://drupal.org/taxonomy/term/90?page=19
To simplify, is Drupal capable of true Web Applications; where the application is a >service and provides custom results to each user? Can it provide a dashboard-like >interface for users to change their settings or preferences? Can it aggregate data from >particular users to provide better results/info to others?
In short, yes. There are so many ways to achieve something you described. But probably they would involve at least the excellent "views"-module. I think of views as some kind of ultimate abstraction SQL layer and UI for anyone. And there are over 300 modules that somehow integrate with Views... ( http://drupal.org/taxonomy/term/89?page=55 )
This sounds that Drupal is all about the modules.. and I know some of my collegues even dislike it for that, because you never get to code fun stuff because it's already been done. At least you can look at the module code and learn from that. Or laugh at it, there's lots of badly programmed modules around too.
When you get to coding modules, you'll probably need lots of time to get used to the Drupal API, Forms API, Module hooks, the Theme override system, and the endless options from contrib modules. But it's worth the trouble.
I find this site very usefull to find a module for some specific need. The site shows the same module info as Drupal.org, but also user feedback/ratings, to find the best option:
http://drupalmodules.com/
If it's unclear, my answer would be go with Drupal :)
PS: D7 should be out very soon. Some might wait for it instead of starting with D6. During D5 people would wait a long time before upgrading to D6 because of missing modules. I believe for D7 the most important modules will be available for D7 very fast. Some research at the moment (04.12.2010):
About 190 modules promise to have a Drupal 7 version the day D7 is released:
http://drupal.org/project/modules?solrsort=sort_title%20asc&text=d7cx&display=table
About 130 modules are already available for D7 (most are included in the previous link):
http://drupal.org/project/modules?filters=drupal_core:103&solrsort=sort_title%20asc&text=d7cx&display=table
EDIT: As a newbie I'm only allowed to post one link, so, I removed http:// from the drupal.org-links
I worked with both Drupal and Kohana.
In my insight it really depends what you want to do. If you are going to make a web application that needs to grow a lot and should be flexible for it's growth then I recommend using Kohana. Kohana is made to keep your codebase clean and supporting in DRY (Don't Repeat Yourself). While it likely doesn't have as many modules as Drupal it does have some Auth and ACL modules.
If you want to be done fast and you don't mind making your application out of others their modules Drupal will get your work done fast. But keep in mind that when you are going to extend you will most likely run into problems that come from modules you don't know. Also it takes a bit flexibility from you.
Ultimately it's your choice. But I recommend using a MVC framework if you are going to write it from scratch.
There is no impossible thing to accomplish. The question is do you want to work with someone else code and try to figure out how to dig inside and extend so it can fit your needs or you want to go with a light framework like Kohana or maybe CodeIgniter(my personal favorite) and drive your own car, although you might need to "invent" some of the wheels.
Go ahead and research what plugins are there to your framework of choice as there are a lot of frameworks providing very good solutions which can provide you with these wheels.
In my personal opinion the time you will spend studying Drupal will be equivalent to the time needed for you to create your basic CMS functionality, but the nerves you will use dealing with stuff out of your control like the core Drupal code will shift the scales in favor of Framework.
The fun stuff about Drupal is what the community calls jokingly rule #35: there is a module for it. Unless you want to do something really tricky, you will often find that the functionality has already been implemented and you just need to configure it.
I am new to both Drupal (7.12) & Kohana (3.2.0)... My experience thus far is that Kohana's documentation SUCKS (or at least, what I've seen of it). And if their website and/or forum is written in Kohana, it sucks as well (slooooow, with overlapping fields, etc.). Whereas with Drupal, it has been clean and so far, very efficient (as best I can tell thus far).
I guess I'm wondering if the comments thus far were focusing on Drupal 6.x and haven't taken into consideration the more recent innovations in Drupal. Any thoughts/comments? Thanks.
As a newbie web developer, I can tell you that you need to analyze the use cases for your web application very strictly. If you are able to cover at least 75% of the use cases you foresee, that's a good start.
With that done, you need to figure if Drupal/Joomla/CMS(x) will give you all of that and with another potential unknown 5-10% feature creep. If so, you maybe better off getting in with Drupal etc.
Else, I think CodeIgniter or Symfony are great PHP frameworks to jump in with. Both offer solid tutorials, video and otherwise, and a helpful community. Kohana, which I am working on, I think you should get into if you really understand PHP and its flaws and realize that speed will be a critical factor. Those are the two big strengths that KO3 brings to the table and you should really need them to use it.
Hope this helps.

Categories