in the last months I made some great progress using vue, and just a couple of days ago a friend asked me if I can do a little plugin for his page, that is made in pure PHP. I made a vue.js component, call it test.vue . It is Single File Component with script and template all togheter. Now, I tested it on my local enviroment on an laravel App the I was developing, and it works fine. But I don't understand how I can add it to the php page of him. In my App, I got NPM running and recompiling all my jss and css, but now that I have this single file I kind of lost the direction.
How can I run the single file component in a out of laravel php page? In laravel I just register the component in my app.js, do the npm mix and then just add the component markup into a blade view and everything works..
Some help will be much appreciate
Related
I'm relatively new to practical web development, so I apologize if the question is stupid. The crux of the problem: I only want to use Vue on the front end of the site, and on the back I am using a PHP framework (or not a framework, it doesn't matter). Connecting Vue to every page via a CDN seems to be wrong to me. I didn't quite understand how the CLI works, does it generate some kind of static files (like a compiler), or does it definitely need Node? And did I understand correctly that I can't use things like Vuex and vue-router without node.js? Thank you in advance!
VueJS and vue-router are totally independent JavaScript framework and router, you do not need NodeJs to use them, you might get confused after using npm but npm is just a package manager, using it is a matter of choice.
The ClI or currently #vue/cli is just a command line that you can use to create new projects and control them, run them etc, using it isn't required when using vue trough a CDN.
About PHP:
There are a lot of ways to use VueJs in PHP but the most convenient one would be creating a PHP API in the back-end and a normal Vue and Axios app in the front-end, this approach is the one you should get used too because its easily implemented in other languages and even PHP frameworks, for example WordPress.
I am new to Nextcloud app development and would like to create a simple app to play around. I saw that some apps are made with Vue.js, so I’m asking if there is a guide out there?
I generated an app skeleton and played around with the PHP templates but unfortunately I don’t know PHP and would like to create a Vue.js project into this existing demo app.
I found some premade Vue components for Nextcloud
https://github.com/nextcloud/nextcloud-vue
but no step by step guide on how to setup the Vue project after creating the skeleton app. I just saw that the Nextcloud app Tasks is also using Vue.js within the PHP code:
https://github.com/nextcloud/tasks
Thanks a lot for help.
I've looked at the repository you mentioned and it's fairly easy to setup, the question is what would you deserve after setup? If you clone the repository you have something like a 'working copy' of the plugin. But this Plugin needs to be build and the resulting package needs to be copied to right location at the nextcloud server (or maybe you have to install the package over frontend). This is some type of plugin and not a full web application which could run standalone, as I understood.
It's not like you said:
Nextcloud app Tasks is also using Vue.js within the PHP code
It's more like PHP is used for Backend and Vue is used for Frontend, these two 'projects' are completely independent from each other (PHP is backend and Vue is frontend there are no direct dependencies). Just create your Vue application (after build you will have an index.html and several js and css files) these files have to be available from browser. Then your applications entrypoint is the index.html. For PHP: You will just define Interfaces and Routes here which will give you the possibility to interact with the serverside. Then later to deploy your plugin, you have to package it in the format nextcloud needs. You can read from Makefile in the Tasks repository what happens if package is created.
I think a good starting point for you would be: https://docs.nextcloud.com/server/15/developer_manual/app/tutorial.html
I'm the frontend developer (strictly frontend) for a Yii2 project, and I've never worked with Yii2 before. I was sent the repo of the whole Yii2 site - front & backend, but my colleagues forgot to send me a database dump to work with.
But going through the views folder, I see what looks like everything required for a PHP site. Can I just set up a webserver and view / modify these locally without requiring the entire rest of the system including database?
Not really my area of expertise here, any advice is appreciated.
I downloaded AngularJS 2 'Hello World' program from the site and followed the procedures to run the program. I have successfully executed program in AngularJS 2 without Codeigniter 3.
But in Codeigniter 3 environment i don't know how to run 'Hello World' program.
I have the following questions:
Path to run the commands like npm install and npm start in codeigniter 3.
Where to place the folders and files like app,pakage.json, etc..?
Is it correct to run the project in codeigniter..? Example: http://localhost:port/angular-2-codeigniter-3-project/controller
Help me to work this in codeigniter 3. And also notify me if i missed some procedures to run the program.
Have a look at https://blog.pisyek.com/create-todo-app-with-codeigniter-3-angularjs-part-2/
It is actually a good start to get the intergration working.
In reply to the solution(the answer needed to be expanded): optional is to create a restFul base in codeigniter to deliver the wanted data.
Build the components and elements using (example: angular-cli) and prefill the components with lorem ipsum values. After you have created a full angular application compile it to production and include the scripts to your views. I usually tend to use the template controller by Glenn Stovall because it is robust and dynamic to not overload the pages with unused js files.
I hope this helps you find your solution.
I am trying to include this module: https://www.npmjs.com/package/react-datepicker-component with react into my Laravel Framework.
I went on to using npm to install it but I am getting no where after that.
I could use some direction. Has anyone tried using NPM for Laravel other than for Laravel Elixir?
I was stuck with this same issue for about an hour trying to pull in the inputmask node package.
The only way I was able to get it included was by attaching it to the window object in app.js (similar to what bootstrap.js does)
window.InputMask = require('inputmask');
If you don't want to load it every time (as it would with app.js) you can create a separate js file that contains only the line of code above and load that on select pages. I feel like there has to be a better way, but this is the only way I've found to make it work.