Jump to content

Is PW a framework?

Recommended Posts


I have a question about PW. For developing totally custom applications/extensions, maybe parse some data from other site or whatever, you should need to build new module. I reckon modules are extensions to PW.

It is said that PW is CMF (Content management framework), that shows when you use it's API. But is it also any kind of framework for PHP, that comes in handy, when developing custom applications? Such as is Codeigniter or CakePHP? Or must be code written in pure PHP?


Best regards,


  • Like 1

Share this post

Link to post
Share on other sites

The beauty of ProcessWire is that it approaches content management without any assumption about what kind of content you're storing, or what you're going to do with it.  Content is data, and data is content, and are accessible equally through the API and the GUI.

You don't need to build modules to take full advantage of PW, or even make templates -- you can just include PW in any PHP script and have full access to its API.

So yes, it would be extremely easy to build a custom web application on PW.  You can just think of it as a way to interface easily and safely with MySQL.  It also happens to have a wonderful GUI backend, objects for santizing user input, and managing sessions.

  • Like 4

Share this post

Link to post
Share on other sites

Technically CodeIgniter and CakePHP are also "pure PHP" and a framework simply gives you a way to get a headstart on development using pre-defined classes etc.

I think what you're really asking is if you can use it as a framework and just access its classes directly as with those framework and the answer is definitely yes, but there is no single correct way to work with it which is the beauty of it :)

In ProcessWire, to use it as a framework you would bootstrap it and use the API to get stuff done. Here are some helpful links on that side of things:

http://processwire.com/api/include/ - The first few lines show how simple it is to include and get started, then this one shows you the vast majority (maybe all?) of the API functions on one page: http://processwire.com/api/cheatsheet/

  • Like 3

Share this post

Link to post
Share on other sites

Like Joss once said: you can also think of Processwire as a CME - content management engine.

In other words, it does anything you want to the degree you understand how to extend on it.

  • Like 2

Share this post

Link to post
Share on other sites

.. and one more take for the same subject, from slightly different angle: ProcessWire is both CMS and CMF in one package, ie. by installing ProcessWire CMF you also get "admin" which is essentially a CMS built on CMF provided by ProcessWire. The line can be a bit blurry at times :)

Anyway, admin uses API behind the scenes, so it's not really that different from any other application you might build with PW (expect for the fact that it's probably larger.) You'll most likely want to keep it available even if you build something similar yourself -- if not for any other reason, at least to give you a nice way to view and manage templates and fields without having to do everything via API (which is of course possible too!)

From my point of view there are two main ways to use ProcessWire as a platform for your applications:

  • Bootstrapping (like Pete explained above) enables you to use it's features from strictly outside PW, ie. you could build whole application yourself and then make PW store (and fetch, sort, sanitize etc.) your data.
  • You could also use more of the framework provided by PW by creating your application as a PW site, using template files for your application / view logic and so on.

You don't really have to build modules to use PW (as a framework or a CMS) but they're a handy way to package some feature you need often into one reusable tool you can pull out whenever there's need for it. They also enable you to tweak how PW works out-of-the-box; you can, for an example, add new methods to PW objects such as Pages, without hacking core code (which is unbelievably useful at times.)

Process modules (one type of modules you can create for ProcessWire) are a bit different in that they integrate directly with admin tools, providing new features there. These let you extend default admin features a lot and more often than not whatever control panel your custom application needs could also be built this way :)

Generally speaking there are many similarities between PW and various web application frameworks like CodeIgniter and CakePHP, but PW doesn't venture quite as deep in the "generic utility" category and also forces as few restraints on you as possible. It's more focused on handling content and data types than providing you tools for general tasks (strings and numbers, email, FTP, complicated image manipulation etc.) and doesn't force a strict application structure (MVC, MTV etc.) on you (unless you build one yourself, like I've done for my own projects.)

I hope this helps understand a bit what PW is, how it relates to other frameworks.. and whether it's the tool you're looking for :)

Extra tip: cheatsheet is good place to start digging in PW. Turn on the advanced mode and you'll get pretty good idea what PW can offer.

  • Like 2

Share this post

Link to post
Share on other sites


I have wondered about the same thing. Coming from a CodeIgniter background (and more recently Yii). I often make comparisons between ProcessWire and frameworks.

The way I see it -- ProcessWire is a framework like Yii, but with several CMS elements added on to make common development tasks faster and easier. Beyond the crucial CMS elements, it's up to you how you actually want the system to behave and look. The syntax for querying the database and creating views is very "expressive" (as they like to say in the Laravel community), and the depth and combinations of your queries is wide open.

ProcessWire is really amazing. With that said, I do see some elements in CodeIgniter (and Yii) that could be adopted by ProcessWire.

I raised similar questions here: http://processwire.com/talk/topic/2393-processwire-framework/



  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Marvin
      Hello, i want to ask, i maintain a website that using a processwire and php, and i want to make an archive at my website using a subfolder system, but when i try,
      the sebfolder is show but when i click the files in that subfolder not show, and my browser just show me an error Invalid argument supplied for foreach(), i don't know why it error
      Here i attach my code and my screenshoot website :
      This is my code

      This is result of my website

      This is my error

    • By abdulqayyum
      Hy Processwire community,
      There are some problem in fileCompiler cache.
      when i change under the directory \site\templates\ it must change under the directory /site/assets/cache/FileCompiler/site/templates/
      but it does not update and functionality working with /site/assets/cache/FileCompiler/site/templates/ directory.
      In this case please suggest me how i clear fileCompiler cache?
      what i have to clear it manually?
      Thanks AbdulQayyum.
    • By abdulqayyum
      Hy everyone,
      i am using loginRegister module for front-end user login.
      In this module user can login with Email/username, i am showing with Email. done
      but not showing Email in Forgotton Password section. there still showing with username.

      i want to show Forgotton Password with Email instead username. and should reset with email.

      please help me in this section, how i can set it with Email.

      Thanks AbdulQayyum.
    • By abdulqayyum
      Markup-Google-Recaptcha is not working with LoginRegister module in Forgotton Password Form.
      Here is my code
      wire-> modules -> process -> ProcessForgotPassword.php
      protected function step1_renderForm() {
              $form = $this->modules->get("InputfieldForm");
              $form->attr('action', './?forgot=1');
              $form->attr('method', 'post');
              $field = $this->modules->get("InputfieldText");     
              $field->attr('id+name', 'username');
              $field->attr('class', 'redesign-field forgotPassFeild');
              $field->setAttribute('placeholder', 'Username');
              $field->required = true;
              $field->label = $this->_("Forgotton Password");
              $field->description = $this->_("If you cannot remember your password to access the affiliates portal. simply provide your username in the box below and we'll send you a reset link via email.");
             // Calling MarkupGoogleRecaptcha Module.
              $captcha = $modules->get("MarkupGoogleRecaptcha");
             //  rendering form with recaptcha
              $submit = $this->modules->get("InputfieldSubmit");
              $submit->attr('id+name', 'submit_forgot');
              $this->session->userResetStep = 1;
              // rendering form
               $out .= $form->render();
              // getting captcha script
              $out .= $captcha->getScript();
              return $out;

      I am following this one example.

      please suggest me how i can show MarkupGoogleRecaptcha in forgotton password.
      Getting log error

      Abdul Qayyum
    • By Mithlesh
      Hi there,
      My form is not getting submitted, it is showing:
      Unable to verify successful email delivery of this form submission.
      Attaching for your reference as well: 

      In the Backend, it is showing Connection timed out with smtp.gmail.com
      Pl guide me how to resolve that
  • Create New...