10quality / wpmvc Goto Github PK
View Code? Open in Web Editor NEWWordPress MVC.
Home Page: https://www.wordpress-mvc.com/
License: MIT License
WordPress MVC.
Home Page: https://www.wordpress-mvc.com/
License: MIT License
Is there any explanation between these different versions? In particular, how does v1 differ from v2?
I am getting the above error when running the
php ayuco setup
command
Hello,
Following the setup instructions I ran composer install
and got the following error;
Deprecation warning: Your package name MyApp is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "a-z0-9/a-z0-9". Make sure you fix this as Composer 2.0 will error.
It seems Composer needs both a vendor name and package name in lowercase like;
wpmvc/my-app
Example:
composer create-project --prefer-dist wpmvc
or:
composer create-project --prefer-dist wpmvc/theme
As title, I think it would be good practice to add to the generated views
defined('ABSPATH') or die();
at top level to avoid direct access to the view files
When defining a models relationship as has_one, it returns an array. Instead if should return a single element.
The function $ file-> exists (assets_path ($ asset ['asset'], $ dir)
in Bridge returned false, but the file exists. Php 7.4, WP 5.7.2
Migrate to gulp 4 to support node 10
Hello, the idea is very good, but it does not exist inside the folder Controller, view, model any file.
You can not see a clear example of how it should be used.
I would also recommend programming with the PSR-4 practices
hi
wordpress-mvc.com not work
Fix gulp to version 4.0.2 to prevent npm errors.
Is there any documentation or example of a Model relationship?
I have a user model and I want to get all the articles of the user, Is there any way to do so?
In my User model, I write this code:
public function tasks() {
return $this->has_many(Task::class, 'post_author');
}
And accessing this in the controller like this:
$user = new User();
$user::find(2)->tasks;
But it doesn't seem to work. I am not sure what I missed.
Based on wpmvc-core
new feature. Add autoenqueue.priority
to app/Config/app.php
.
10quality/wpmvc-core#24
Hi!
I recently discovered this plugin, before I used to develop my plugins using tombener/wp-mvc, but seems it is abandoned and also restrict due some security issues.
I was reading the Documentation and tutorials and playing with some test plugins, so I faced a funny fact:
There's no way to unify this? I mean, have a single dependency's vendor folder with all the reusable libraries?
So far I could understand, we can use Wordpress with composer, I'm personally using it on my personal projects/themes/plugins, and I used to have the following structure:
So, maybe you guys can advise how to use 10quality/wpmvc without to duplicate this dependencies, because I really couldn't understand.
Add package-lock.json
to gitignore.
Hello, npm audit returns the following: 25 vulnerabilities (2 low, 2 moderate, 17 high, 4 critical).
Regards,
Hello,
I installed the wpmvc framework. when i try to run
php ayuco setup - I am getting this error. Also cannot find the SetCommand Class in the vendors folder
Fatal error: Class 'WPMVC\Commands\SetCommand'
Is there anyone maintaining this repo or the users are left on their own?
When I run the php ayuco setup
command on my linux machine i get the following error
PHP Fatal error: Uncaught Ayuco\Exceptions\NoticeException: addCommand: No configuration file found. in /www/app/wp-content/plugins/....../vendor/10quality/wpmvc-commands/src/Base/BaseCommand.php:58
Stack trace:
#0 /www/app/wp-content/plugins/....../vendor/10quality/wpmvc-core/src/lib/functions.php(114): WPMVC\Commands\Base\BaseCommand->__construct()
#1 /www/app/wp-content/plugins/....../ayuco(18): get_ayuco()
#2 {main}
thrown in //www/app/wp-content/plugins/....../vendor/10quality/wpmvc-commands/src/Base/BaseCommand.php on line 58
This is due to case sensititve filesystems in Linux. I fixed it by changing the following lines in BaseCommand.php
constructor
// Check for MVC configuration file
$this->configFilename = file_exists($this->rootPath . '/app/config/app.php')
? $this->rootPath . '/app/config/app.php'
: null;
like this:
// Check for MVC configuration file
$this->configFilename = file_exists($this->rootPath . '/app/Config/app.php')
? $this->rootPath . '/app/Config/app.php'
: null;
Hi @amostajo
I wanted your thoughts on supporting a custom plugin filename so instead of just plugin.php users can provide their plugin with pluginname.php.
It's often the convention with WP plugin development to have your main plugin loader file the same name as your plugin.
In my current copy I've renamed plugin.php but am finding it's throwing some errors on set commands as they are looking for plugin.php and not my custom filename.
Am thinking could be implemented by adding an option to the config/app.php file with the plugin filename and if set use it for looking up the plugin file during set command replacements.
I hope that makes sense
Hi, we got this error when we upgrade PHP 8.0.
[28-Apr-2021 10:35:29 UTC] PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given in /10quality/wpmvc-core/src/psr4/Response.php:124
Hi @ALL, i'm try out your framework in one of my plugins. The Framework itself is very helpfull, thanks for that, great Job.
I get this message on gulp compilation with gulp dev, but only if the webpack.config.js is present.
[07:21:37] The following tasks did not complete: dev, scripts, webpack, webpackPromise [07:21:37] Did you forget to signal async completion?
Without the webpack.config.js it runs well.
Npm run webpack without arguments is also ok. When i use --hide-modules instead, i got a error
[webpack-cli] Error: Unknown option '--hide-modules' [webpack-cli] Run 'webpack --help' to see available commands and options
Here is the part of my dependencies in the package.json
"dependencies": { "axios": "^0.21.1", "bootstrap-icons": "^1.9.1", "gulp": "4.0.2", "gulp-wpmvc": "^1.3.*", "vue": "^3.2.37" }, "devDependencies": { "bootstrap": "^4.6.2", "webpack": "^5.74.0", "webpack-cli": "^4.10.0" },
Webpack Configuration
`
const path = require('path');
module.exports = {
mode: 'development',
entry: {
'admin': './assets/raw/js/admin/index.js',
'app': './assets/raw/js/main.js',
},
output: {
filename: '[name].js',
path: path.resolve( __dirname, 'assets/js' ),
publicPath: './assets/js',
},
target: 'web'
};
`
and here is the gulpfile.js
`
// --------------
// START - CUSTOM TASKS
gulp.task('vendorcss', async function () {
return gulp.src([
'./node_modules/bootstrap-icons/font/bootstrap-icons.css',
])
.pipe(gulp.dest('./assets/css'));
});
gulp.task('vendorjs', async function () {
return gulp.src([
'./node_modules/vue/dist/vue.global.js',
'./node_modules/axios/dist/axios.min.js',
])
.pipe(gulp.dest('./assets/js'));
});
config.prescripts = ['vendorcss', 'vendorjs'];
// END - CUSTOM TASKS
`
All of the Setting comes from your documentation.
Do you have any idea how i can fix the async completion? It is a bug or should i use maybe one of other webpack versions?
Hi @amostajo I got stuck on this for a while as I overlooked the requirement;
NodeJS (< v.10)
I kept hitting the [email protected] postinstall script issue but wasn't sure how to resolve with wpmvc. On other projects like JointsWP I was able to just bump gulp-sass in the package.json and everything was honky dory, see the bug I fixed with help on JointsWP;
JeremyEnglert/JointsWP#317 (comment)
For wpmvc I can't seem to do this as the dependency comes I believe from gulp-wpmvc or another loaded component and not the core.
If you could point me to where gulp-sass/node-sass is referenced as a dependancy hopefully we can resolve the NodeJS old version requirement with a simple version bump on the sass dependancy.
Thank you
Title question, don't really wanna have it in main plugin file.
The framework is well documented but i think, some essentials thinks are missing.
I can't see some Routing feature, so, how call a simple controller's method in a view (link or button) ?
Is there any sample (or plugin project) showing how doing the CRUD of a custom model ?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.