This plugin has been removed from the directory as WordPress does not allow frameworks. Although the plugin was grandfathered in to continuing to operate, the WordPress plugin team has made it clear that they really don’t want it listed in the directory anymore. As a result, if you are actively using the plugin you will need to pull it from GitHub instead: https://github.com/tombenner/wp-mvc
Documentation is also still available at: https://wpmvc.org/
We welcome your contributions and pull requests!
]]>I just created a new module by duplicating the Event but i am facing the error of “[MVC] Warning: View “admin/add” not found.”.
]]>how can we use our new created plugin without WP MVC plugin after creation the new plugin?
]]>Is there a way to access views without Permalink? I’m trying it this way,
https://localhost/wordpress/wp-content/plugins/wp-mvc/wp_mvc.php?
What params should follow next? Please give me some hints!
]]>I think you need to add shortcodes for each item into the admin page.
It’s important for users to easily use shortcodes in plugins.
Hi,
I’ve a WordPress local project with wp-mvc actived.
I use wamp server on Windows and phpstorm as IDE.
When I try to use >php wpmvc command, I obtain this message :
mvc_core_path=”$(dirname $0)/core/”
# Allow for a custom path to the PHP executable to be set in $WPMVC_PHP
if [ -n “$WPMVC_PHP” ]; then
eval “${WPMVC_PHP} -q ${mvc_core_path}wpmvc.php $@”
else
php -q “${mvc_core_path}wpmvc.php” “$@”
fi
I don’t understand how to solve this issue in your doc.
Can you help me, please ?
Best Regards
Eric.
Hello Tom,
Could you please avoid usage of create_function(), as it is deprecated in php7.2?
Thank you.
]]>i tring the plugin and i created a controller which display only hallo.
but no sidebar is display.
my question with which theme file the the view is rendered? (index.php or page.php etc!!)
I just upgraded my php to 7.1 and when I tried to activate the wp-mvc plugin, I get a 500 and nothing in wp will load. I am using wp-mvc version 1.3.10.
I then tried downgrading to php 7.0.26, but still not working.
I am not even sure where to look for the problem.
Any suggestions would be greatly appreciated.
Hello,
I’m very interrested by the new file input type added in version 1.3.7
I ask a few question here as I didn’t find the answer in wpmvc.org.
I added this line in my form.
echo $this->form->file_input('cc_resp_picture', array('label' => 'Image', 'class' => 'form-control'));
It shows a file input form and the image name is recorded in the ‘cc_resp_picture’ field of my database. But the file itself seems not to be uploaded. How can I move the uploaded file where I want ?
]]>How can I make an ajax call from an admin page to the admin controller?
So far the only way I saw to do ajax from an admin view was to create a separate public controller and hit that. The problem with that is exposure to the world and an additional controller. I do check the current logged in user for security, but would prefer not using something that is exposed for admin functionality.
thanks.
]]>I have a plugin that I would like to migrate to MVC using this plugin.
I followed the instructions on the documentation to create a CPT but I’m not clear on how to show the DEFAULT TEMPLATE (admin area) that WordPress shows when a CPT is created.
Can you guide me with this please.
Here is the code in my old Plugin to create a CPT:
public function registrar_cpt_servicios() {
$servicio_labels = array(
'name' => _x( 'Servicios', 'post type general name', 'estilotu' ),
'singular_name' => _x( 'Servicio', 'post type singular name', 'estilotu' ),
'menu_name' => _x( 'Servicios', 'admin menu', 'estilotu' ),
'name_admin_bar' => _x( 'Servicio', 'add new on admin bar', 'estilotu' ),
'add_new' => _x( 'Nuevo servicio', 'book', 'estilotu' ),
'add_new_item' => __( 'Agregar nuevo servicio', 'estilotu' ),
'new_item' => __( 'Nuevo servicio', 'estilotu' ),
'edit_item' => __( 'Editar servicio', 'estilotu' ),
'view_item' => __( 'Ver servicios', 'estilotu' ),
'all_items' => __( 'Todos los Servicios', 'estilotu' ),
'search_items' => __( 'Buscar servicios', 'estilotu' ),
'parent_item_colon' => __( 'Servicios padres:', 'estilotu' ),
'not_found' => __( 'No se encontraron servicios.', 'estilotu' ),
'not_found_in_trash' => __( 'No se encontraron servicios en la papelera.', 'estilotu' )
);
$args = array(
'labels' => $servicio_labels,
'description' => __( 'Servicios que ofrece un proveedor de Servicios.', 'estilotu' ),
'public' => true,
'publicly_queryable' => true,
'rewrite' => array( 'slug' => 'servicios' ),
'capability_type' => 'post',
'show_in_menu' => true,
'menu_position' => 5,
'hierarchical' => false,
'supports' => array('title','editor','author','thumbnail','excerpt','comments','custom-fields'),
'has_archive' => true,
'capability_type' => 'post'
);
register_post_type('servicios', $args);
}
Thanks
]]>Hello, while plugin installs generated code ok on wamp I have issues running code generation on vagrant.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Database Error</title>
</head>
<body>
<h1>Error establishing a database connection</h1>
</body>
</html>
Based on previous topic solution I have tried setting wp-config db host as follow but no results:
localhost:/run/mysqld/mysqld.sock any help greatly appreciated, for now I’ll keep playing with plugin on wamp but working it on vagrant / scotchbox would be nice as well.
Kindest L.
I’m looking at how to use WP MVC with the Plaid cakePHP application. Here’s the GitHub Link
Is WP MVC able to use other cakePHP applications? Thanks!
]]>[MVC] Warning: Undefined property: DocumentationVersion::Array.
Thrown on line 193 of C:\sites\mvctestsite\wp-content\plugins\wp mvc\core\helpers\mvc_helper.php
When following the example described.
]]>[MVC] Warning: Undefined property: DocumentationVersion::Array.
Thrown on line 193 of C:\sites\mvctestsite\wp-content\plugins\wp-mvc\core\helpers\mvc_helper.php
When following the example described.
]]>Hello!
I’m developing my first plugin with wp-mvc and i have a question.
Is there any built-in method to add standart wp wysiwg editor to my form?
Is there any documentation about integrating with existing WP models, specifically users? All I could find is this very incomplete one-page document:
https://wpmvc.org/documentation/wordpress_data_integration/models_for_wordpress_tables.html
I tried to follow it, but there’s simply not enough information to see.
My use case is this: I have Order model which belongs to one WP User. I tried to build the relation between them by analogy with Event and Venue models from the Event Calendar Example plugin, but it’s not working that way.
This plugin really has some great potential, but unfortunately its documentation is unbelievably poor. Any plans on improving the docs any time soon?
]]>I went through the entire tutorial, easy to follow. https://wpmvc.org/documentation/tutorial/
Under the WordPress dashboard -> Venues.
I can successfully add, delete and edit a record but when I click View, I get a “Oops, that page cannot be found”
Great product, I can’t wait to keep working with it!
]]>Hi there
I want to know how to see the MVC menus from other roles, like ‘editor’ or ‘author’. In current state, only the ‘admin’ role can see all the menus.
What I have to do?
Thanks in advance
]]>Hi,
I am trying to use wpmvc command for code generation but get following error
root@NX00504:/var/www/wp4site/wp-content/plugins/wp-mvc# wpmvc generate plugin test
wpmvc: command not found
root@NX00504:/var/www/wp4site/wp-content/plugins/wp-mvc#
Please guide me what is the problem with this.
Platform: Ubuntu 14.10
Thanks
]]>I have a wordpress website and cant log into my dashboard due to a problem with the WP-MVC plugin stated below. I was curious if you have ever seen this or could point me in the right direction to resolve this problem.
[MVC] Fatal Error: The file “models/prod_option.php” couldn’t be found in any apps.
Thrown on line 18 of /home5/vicmobil/public_html/wp-content/plugins/wp-mvc/core/functions/functions.php
Thanks!
]]>Hello,
When you try to save a record for a first time (on a Public controller) validation is not triggered. I’m using the save method as it is described in the documentation.
I checked the code of MvcModel->save() method and the validation is triggered only for already added records. Take a look at the following if statement:
if (!empty($data[$this->name][$this->primary_key]))
It should be fixed to be triggered always.
Greetings,
Jordan
Hello @robert Peake,
there are some really useful methods that are only available for Admin controllers. They are located at MvcAdminController class.
For example:
I think it will be really useful this methods to be reusable for both controllers – public and admin. Maybe they should be relocated at MvcController class (possibly there is a need of a small refactoring).
Greetings,
Jordan
I had started with WP MVC-1.2 everything was working fine. But after upgrade to 1.3, old public controllers are working. But new public controller which has been generated after upgradation not working returning 404 error. Where as Admin Controllers are working
]]>Hi,
Notice: A session had already been started – ignoring session_start() in /www/htdocs/site/wp-content/plugins/wp-mvc/core/loaders/mvc_admin_loader.php on line 36
Regards
]]>New to WordPress and MVC development, looking for a single reference of all naming conventions used in wp-mvc. Does it exist?
I have read that wp-mvc borrows many naming conventions from Rails and CakePHP. Is that the best clue I have to get started?
I validated my form fields with the method given in WP MVC and it flashes just the bar and no description was given in the bar. I have added here the code and the screenshot. Any wild guess or idea to repair this?
![Add Currency Error][1]
[1]: https://i.stack.imgur.com/0wf50.png
In the model, I have given the validation code:
/app/model/currency.php
var $validate = array(
'currency_title' => array(
'rule' => 'not_empty',
'pattern' => '/^[A-Za-z]/',
'message' => 'Enter Capitalized Currency Title'),
'currency_code' => array(
'rule' => 'not_empty',
'pattern' => '/[A-Z]/',
'message' => 'Enter Currency Code - CAPITAL Alphabets only'),
'currency_numeric_code' => array(
'rule' => 'not_empty',
'rule' => 'numeric',
'message' => 'Enter Currency Numeric Code - Only Numbers')
);
And the create_or_save() function in the admin_controller is overwritten like this:
public function create_or_save() {
if (!empty($this->params['data'][$this->model->name])) {
$object = $this->params['data'][$this->model->name];
if (empty($object['id'])) {
// This 'if' is necessary for the fields in the form to be validated
if ($this->model->create($this->params['data'])) {
$id = $this->model->insert_id;
$url = MvcRouter::admin_url(array('controller' => $this->name, 'action' => $this->_redirect_action, 'id' => $id));
$this->flash('notice', 'Successfully created!');
}
else
{
$this->flash('error', $this->model->validation_error_html);
}
$this->redirect($url, $msg);
}
else
{
if ($this->model->save($this->params['data'])) {
$this->flash('notice', 'Successfully saved!');
$url = MvcRouter::admin_url(array('controller' => $this->name, 'action' => $this->_redirect_action, 'id' => $id));
$this->redirect($url);
}
else
{
$this->flash('error', $this->model->validation_error_html);
}
}
}
In the above code, the third ‘if’ condition is the one meant for successful validation, but it is skipped and the first ‘else’ condition is met only to display the screenshot given above.
Awaiting useful help/ideas/guesses.
Thanks
]]>i need a complete example to develop a plugin using wp-mvc. the plugin is for doing all database operations. the tutorial given in wpmvc.org is not that much helpful as it does not contain even a single practical example. Any better documentation other than this available? or any website that can guide to do the same?
]]>I am getting tons of strict standards and warnings when I activate WPMVC and / or use any plugin based on the framework.
Activating any plugin from their examples and then creating a new EMPTY plugin results in a fatal errors about classes being tried to be redeclared.
Is it my installation or there is not WP4 support?
Thanks,
Vlad