what is simple MVC based PHP blogging application? - model-view-controller

I am searching for a Blogging tools like wordpress. But I want MVC based tools to extend my blog with MVC structure.
My main requirements is
Must be based on MVC
Simple & lightweight
it's blog url structure should be domain.com/cat_name/post_title , because my current wordpress blog is like that, I don't want to lose Facebook Share and Tweets.
I want a simple one, because this is learning only.

Clarifying: if a CMS you use is based on a MVC design pattern or not is irrelevant to you as an user, except if you want to meddle with its inner workings (which you don't - a CMS is made to be used and possibly extended, but in 99% of use cases, if it isn't extendable to your needs, changing the source code is a bad idea, as it will most likely break with any updates you may want to make)
You may want a MVC framework, which will in turn allow you to **code** a CMS of your own, or use a good, extendable, CMS app
The one I use is ProcessWire, which is a CMS/CMF (F stands for Framework) php app, and seems to be the kind of thing you are looking for - it manages your content for you (the default installation comes with a few demo pages) but you define the fields, and you use them to display your content at will. Check it out - the user forum is quite active, and people there are really helpful.

Well there are tons of Content Managment System Based on MVC frameworks (eg . CodeIgniter ) . I personally recommend Pyro ( Based on CodeIgniter) but other also seem promising . but i don't know much since i haven't tried .

Note that this is a highly relative question and will bring forth a ton of opinions and not real answers. With that in mind, here is my answer.
I know of a tool that you can use to install an MVC template for and on top of ProcessWire along with basic project managing tasks using gulp. Note, the M will be considered ProcessWire.
Have a look on github.com and look at the profile of fixate and repo generator-fixate-pw. (ie: generator-fixate-pw, added the sentence if the link breaks).
Install this by following the instructions on the repository. The tool is very specific but learning to use the framework helped improve my php skills allot (still learning allot).
Whether the CMS will be used as a blog or not will depend on your implementation of the install.

Related

Demandware MVC concept

I am new guy to Demandware and I am switching from Magento to Demandware.
Demandware is not opensource I am not getting proper tutorials, stuff to understand the concepts of it.
I am from Magento so I know the Magento MVC structure.
But in Demandware we have different concepts like pipelines, pipelets, ISML scripts, ECMA script, DW scripts etc.
I want to know the MVC pattern of Demandware.
How it works and what are the basic concept I need to concentrate?
I would suggest to request a Demandware XChange account as soon as possible for you, so that you get access to the Demandware community portal and also to the API documentation.
In short:
Models are Demandware Forms and Demandware API objects
Controllers are Demandware Pipelines (there are JavaScript Controllers that are recently released, you may find these easier to understand if you have Node.js experience). These can call DW Scripts (DemandwareScript is based on ECMAScript standard 5.0 for JavaScript with some extensions like E4X and optional types)
Views are the isml templates. You should avoid including a lot of logic in them, either with isml tags like isif, isloop, etc. or with isscript.
Any further questions - let me know.
Hope this helps,
Zlatin
I hope you'll be able to avoid pipelines and dwscript. Those are a bit older. The most recent version works with plain old JavaScript, with pipelines being replaced by controllers.
Be aware that the underlying JavaScript engine is Rhino, which isn't really modern.
The Demandware documentation is open source now anyone can access to without having an exchange account it has the latest SFRA(javascript) based concepts as well
here is the link for the docs
Demadware Documentation
Demandware is very much designed around the MVC concept (in theory). The pipelines are basically your controllers and each pipeline filename (the xml file) is the first part of the URL and the start nodes inside the pipeline are the second part of the URL that basically represent the controller (eg Cart.xml has a start node called Show, so the url is Cart-Show). At the end of the pipeline flow chart is, usually, an interaction node to that links to an ISML file, those are basically the View and are HTML with some minor Demandware-specific markup.
Typically in the MVC world you try to prevent putting business logic in the views, however if you use SiteGenesis as your starting point you'll find that not to be the case on most of the pages. If you switch to using Javascript Controllers instead of Pipelines, then it'll be closer to the Magento style of MVC (but using NodeJS-like syntax).

best CRUD library for codeignitier?

Using codeigniter 2. Don't want to reinvent the wheel. Have tried Grocery_CRUD and found it takes as long, or longer, to learn it that it did to learn codeigniter.
Looking for crud library that makes sense, easy to learn so I don't reinvent the wheel.
Many thanks for any ideas.
You can use http://www.grocerycrud.com
It's easy to use with codeigniter.
Sample use
$this->grocery_crud->set_table('customers');
$this->grocery_crud->columns('customerName','phone','addressLine1','creditLimit');
$this->grocery_crud->render();
Also you can take look at https://github.com/jamierumbelow/codeigniter-base-model
This is very basic base model class for CI
Subjective but take a look at https://github.com/keevitaja/simple-crud-codeigniter
Why don't you try MY_Model to do all the CRUD functionality?
MY_Model
Just want to inform all you that I have released CRUDDER. This is a plug-in module for your application that works as a CRUD solution, ideal for systems back-ends.
CRUDDER is developed using CodeIgniter and Bootstrap for look&feel. You can develop your own skin appart from the Bootstrapped one. Full localization is possible. CRUDDER is designed to be intuitive and easy to use. The interfaces always show on-line help tips related to the CRUDDER itself and also to your database characteristics.
I'm attaching here an image of the CRUDDER example contained in the product web page so you can figure how easy it's to use.
On the other hand, you will find that configuration is very easy. There is no need to write code other than your own custom validation rules (more powerful than the CodeIgniter ones). There are only two classes: one contains all the functionality code and the other, Crudderconfig, encapsulates the configuration and localization parameters.
In contrast to other commonly used open-source CRUD solutions available, in CRUDDER all the table-and-field-specific metadata don't require to write code. All of this is contained in two "metatables", that can also be managed using the CRUDDER itself... so you use the CRUDDER to create your own CRUD rules (don't need to use phpMyAdmin, for example). This is a plus for users seeking for simplicity.
A full list of features is available:
Open the project web page
Among them:
Pluggable to applications not developed with CodeIgniter.
Sort, filter and pagination features, among others.
Soft deletes with unique-index collision avoidance.
Automatic menu-type form fields based on other tables content.
Extensible event triggering when a value is changed in a form.
Interface help tips for fields are contained in the database.
Designed with strong security in mind.
Take a look! Write me if you like it, have questions or want another functionality.
CRUDDER is released under the GNU LGPL license.

Is WordPress MVC compliant? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Closed 7 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Some people consider WordPress a blogging platform, some think of it as a CMS, some refer to WordPress as a development framework. Whichever it is, the question still remains. Is WordPress MVC compliant?
I've read the forums and somebody asked about MVC about three years ago. There were some positive answers, and some negative ones. While nobody knows exactly what MVC is and everybody thinks of it in their own way, there's still a general concept that's present in all the discussions.
I have little experience with MVC frameworks and there doesn't seem to be anything about the framework itself. Most of the MVC is done by the programmer, am I right? Now, going back to WordPress, could we consider the core rewrite engine (WP_Rewrite) the controller? Queries & plugin logic as the model? And themes as the view? Or am I getting it all wrong?
Thanks ;)
Wordpress itself is not architected in MVC, but one can build very MVC oriented themes and plugins within the framework. There are several tools which can help:
WordPress MVC solutions:
Churro: # wordpress.org/extend/plugins/churro
Tina-MVC: # wordpress.org/extend/plugins/tina-mvc
Plugin Factory: # wordpress.org/extend/plugins/plugin-factory
MVCPress: http://mozey.wordpress.com/2007/01/22/mvcpress-screenshots/#comment-3634 (abandoned, but interesting ideas)
MVC threads on WordPress.org Ideas and Trac:
http://wordpress.org/extend/ideas/topic/mvc-plugin-framework
http://wordpress.org/extend/ideas/topic/complete-reestructuring
http://wordpress.org/extend/ideas/topic/rewrite-wordpress-using-mvc
http://wordpress.org/extend/ideas/topic/wordpress-theme-revamp (more on XSL than MVC)
http://core.trac.wordpress.org/ticket/12354 (on MVC in widgets)
Wordpress is kinda-sorta MVC. If anything it is a pull-type MVC layout, where the View 'pulls' data from the model. It does this in a very proceedural way, instead of using lots of different objects, but this actually makes the front end templates easier to write in a lot of ways.
This also gives the views some degree of controller logic (thus the kinda-sorta MVC).
Lets run this down:
Wordpress gets a URL. The wordpress core acts as a controller and determines what initial queries to run of the database, and by extension, what view should be loaded (category view, single post or page view, etc). It then packages that INTIAL query response and sends it to the view file.
That view file CAN be a strict display only file OR it can request additional information/queries beyond the built in one. This is the pull-type of the MVC, where the view pulls data from the model instead of the controller 'pushing' data from the model into the view.
Thus, when the view sees code to load a sidebar or widget area, it asks for that information. However, what widgets should be there is determined by the controller, which looks at the model for what widgets are in the sidebar, and then selects those that are set to show on the current page, and returns those to the view.
That each part of that isn't an object doesn't make this any less MVC. You can alter WP core without (necessarily) altering anything about a theme. Similarly, as long as you use built in functions like 'get_pages()' then the model and the database tables could change as long as those functions still returned the right data. So, the model is independent of the view, and the controller is independent as well (except when the view adds controller logic to do more than the core normally does).
While you COULD have a model object holding a number of methods and stuff like WPModel::get_pages('blah blah'), and contain everything that way, there is still fundamental separation of concerns.
View: template files
Controller: WP core
Model: the various functions that handle specific data handling.
As long as the names, arguments, etc, stay the same (or just have new ones added) then separation of concerns is maintained and one can be altered without disturbing the others.
It isn't a super-clean version of MVC, (especially when hooks get involved), but at a basic level it starts there.
And being proceedural about it isn't a bad thing IMO. A request from a website is pretty inherently proceedural: it is a process with a clear beginning and end, and just needs a procedure to process the request, get data, package it, then die. You can set up those steps with objects and object methods and OOP layouts (which would make some things easier) or you can just write alot of function calls and separate them out that way. Class members like private variables are lost that way but depending on the needs of the application... you might not care.
There is no one-grand-way to do development, and WP sits at like 20% of websites so it is doing something right. Probably something to do with not making people have to learn/memorize complex class hierarchies to get the database to answer the question 'what pages are child of page x?' and deal with that data. Could you make it that easy with OOP? yes, but if Joomla is any example of how hard it is to implement a complex custom website with OOP, then WP is FAR easier and quicker, and time is money.
As already mentioned in the comments, MVC is an architectural design pattern, not a specific framework, and no, Wordpress doesn't follow the MVC pattern.
There is a separation of views (templates) from the programming logic, but only in the frontend, not in the admin panel and a general separation of views and application logic is not inevitably MVC. An implementation of the MVC pattern usually assumes some kind of object oriented programming paradigm behind it and Wordpress is mainly implemented in a procedural way, with plain SQL queries in the PHP functions, therefore not having an actual model either.
One of the topics that periodically crops up in discussions as it relates to WordPress is the idea of WordPress and MVC.
But the thing is that MVC is not the silver bullet of web development that we try to make it out to be. Yes, it’s an awesome design pattern, and I personally think that it fits the web application model like a glove, but not every framework or platform implements that design pattern.
Case in point: WordPress is not MVC.
And that’s okay. I think we need to leave the desire of trying to shoehorn it into our projects aside especially when the pattern WordPress provides is not only sufficient, but works well when leveraged correctly.
“But I Love MVC!”
So do I! In fact, I spent the last year working on a project that more-or-less mimicked the MVC architecture.
A high-level example of MVC.
A high-level example of MVC.
For example:
Views were implemented using templates
Controllers were implemented by a combination of using function names like create, read, update, destroy, delete, and so on (even though these functions were hooked into the WordPress API
Models were functions also were called to validate and verify data prior to serializing the data. Again, this required that certain functions be hooked into WordPress to achieve the desired result.
Finally, a set of rewrite rules gave the application a clean set of predictable URLs in the format of /people/update/1 or /people/all.
What Pattern Does WordPress Implement?
WordPress implements the event-driven architecture (of which there are several variations such as the Observer Pattern).
In short, you can conceptually think of this as the following:
Things happen when WordPress is processing information.
You can register your own function to fire when these things happen.
Not too complicated, is it?
A high-level example of event-driven patterns
A high-level example of event-driven patterns
When you begin to think in terms of the paradigm in which it works rather than trying to make it work the way that you want it to work, it’s liberating. It helps to solve problems much more easily.
The bottom line is this: WordPress implements the event-driven design pattern, so even if you end up trying to implement MVC, you’re still going to have to utilize the hook system.
If you’re not careful, you can end up trying to craft the perfect architecture without actually getting your work done, and thus end up finding yourself so high up in the atmosphere of software that you’ve effectively become an architecture astronaut.
So You’re Saying Avoid Design Patterns?
Not at all! Design Patterns serve a purpose because, above all else, they basically give us solutions to previously and commonly solved problems. Use them!
But the point I’m trying to make is that we don’t need to try to force things to fit pattern just because we like the pattern. That’s not their purpose. Instead, leverage the primary pattern that your platform of choice implements – in our case, it’s an event-driven pattern – and then implement patterns where they fit (such as dependency injection or something like that).
Otherwise, it’s like trying to put your foot in a glove.
Courtesy (and totally copied :P) from : http://tommcfarlin.com/wordpress-and-mvc/
Just to update this with more recent information for people hitting this from search engines - the wp-mvc plugin http://wordpress.org/extend/plugins/wp-mvc/ goes a long way to creating a mvc framework for plugin development. You can find out more here: http://wpmvc.org/documentation/70/tutorial/
Just to add to the list of options, (I'm admittedly biased as the author,) swpMVC is a fully featured, lightweight MVC framework, inspired by Rails, Sinatra, Express, and FuelPHP. It's thoroughly documented, and while I have used and enjoyed wp-mvc, I wanted something where the models were able to populate views themselves, including form controls for interacting with said models.
I put this together largely to reduce the amount of controller code required to put together an app on top of WordPress, and the result is a very fast and effective framework that runs inside WordPress. The models are based on PHP Activerecord and 8 models are included for existing WordPress data types, including Post, PostMeta, User, UserMeta, Term, and a few more. Modeling data is very easy thanks to the activerecord library, and I've enjoyed working with this framework immensely thus far.
Also ships with underscore PHP and PHP Quick Profiler (as seen in FuelPHP.)
RokkoMVC is a micro MVC framework built especially for WordPress. The project is meant to simplify AJAX functionality in WordPress applications, as well as bringing in all the other benefits of using models, views, and controllers to your theme.
I had a bash recently at creating a plugin that makes use of a simple view-controller system, and quite liked the results, so I separated the template stuff out to its own repo. It offers object-based controllers, passing variables locally to PHP templates, template fragments (templates within templates) and components (template fragments with their own sub-controller). All in two tiny classes!
Of course, I wrote this code thinking that no other WP developer had considered the problem before ;-).
It's far from mvc, there is no kinda-sorta thing like some people say, it's either MVC or not... The fact that you write logic on the view level doesn't qualify it as a mvc framework. The reason people use it - it's easy to learn, you don't need to be hardcore php programmer, they're lazy.

Codeigniter admin/auth system?

I'm starting a new project with codeigniter, and I'd like to start on a system that's already built so I can reduce the time of development.
Is there a good system that handles user authentication along with an admin interface to manage users that can be easily expanded to a web-app?
If this is too vague, I can expand
This thread here appears to have some answers
But the question was more about libraries. Either way, implementing some of the things on that thread would save you time.
You're looking for is a Content Management System (CMS).
There are a few ones out there that use Codeigniter as a framework for their CMS.
Edit: Even if you can't find a boilerplate CMS that you like, you can google about CMS's to design a simple one of your own as there's LOTS of tutorials and information about requirements and such when you know the term CMS.
I recommend Redux Auth for CodeIgniter. It comes with an example implementation, and can easily be used to manage user authentication for your CodeIgniter site. I just implemented Beta2 with the latest version of CodeIgniter, so while it's not actively updated, it still works with the latest build.
I'm using Bonfire as default admin interface.
I've just started looking into Bonfire:
Bonfire helps you build CodeIgniter-based PHP web applications even faster, by providing powerful tools and a beautiful interface you won't be ashamed to show your client.
Ready to customize Admin Interface.
User Management with Role-Based Access Control.
Fully Modular codebase.
Built around HMVC.
Database backup, migration, and maintenance.
Powerful, parent/child capable theme engine.
Simple Email Queue to keep your ISP happy.
UI-based module builder.
Looks good at first glance!

several languages in codeigniter

I want to implement several languages on one site (codeigniter framework). There are four country flags in the design. When user click on any flag the page should load the information in chosen language. There is no registration on the site (The site is quite simple).
I'd like my url's to be like this: http://site.com/en/controller/
What's the best(most simple) way of doing it ?
There is a Code Igniter guide for this here:
CI Wiki: Internationalizing the Language class
Internationalization and the Template Parser Class
Unfortunately no web framework will "solve" this for you, it can only make it easier. Content will be replicated in the languages, etc. What this does is help you make in parallel the M_C portion of the site. The views will need to all be translated still by you.

Resources