How to run AngularJS 2 with Codeigniter 3 in Windows OS..? - php

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.

Related

PHP + Jquery + cypress.io setup in a classical MVC application. How to?

At work we have an application built with php (codeigniter) and lots of jquery, don't ask :)
It's not a modern app, is a classical MVC PHP app. Would it be possible to integrate cypress.io with as less changes to the current estructure?
My idea was to install cypress.io in a separate folder and run the tests from there
is it a feasible solution?
Yes - you can test any web application with cypress.io.
I have done exactly as you describe.
How? - You can
add a folder to your existing source control,
run your development web-server as you normally would,
set the baseUrl to your development server (e.g. http://localhost:8080/),
write some tests & assertions that use your existing markup to find buttons, text etc,
and run cypress to test your app.
Take a look at "getting started" in the docs
You might also want to look at asdf-vm now that you will have node & php

App development setup with PHP and Vue.js

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

Use a single page component.vue in a not laravel php page

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

Creating first PHP CLI, getting started

Hello I would like to create a simple PHP CLI to do some scaffolding. For a new project I am working on, we are using Magento to build an eCommerce store. Magento to comes with many default modules, but you can also create your own and we will have to be creating many custom modules.
I would like to create a simple PHP CLI which can be run to generate a default file path/structure for a module. It would be passed in something like the module name and maybe even path of the application and then generate the template folders and files.
I am new to PHP development, so i think this will be a simple enough project and a good learning experience. However I am having trouble knowing where to start. The end goal would probably be to have it archived in a .phar file that can just be run on the command line.
Any suggestions on how I can get started with this?
Thanks for any help, it is much appreciated.
No reason you can't. PHP in the command line reads the $argv array from the command line.
Here's one of my CLI apps; perhaps it can be instructive: https://github.com/dalecosp/NixArchive/blob/master/archive

Continous Integration and Cakephp 3.x internationalisation with multiple plugins in project

In our use case we're using cake 3's plugins to seperate different front-ends for the same data (simplified explanation) - and because of this, we have a a lot of `__('random_strings'); spreaded out in files in following paths:
src/*
plugins/plugin_name(s)/*
I'm using the following command to extract the .potfiles:
bin/cake i18n extract --app /cake/ --paths src,plugins --merge yes --output /cake/src/Locale --exclude test,vendors --overwrite --extract-core yes
We're using Jenkins with an Ant script for bulding our application, and we're about to choose a online web gui for translating these .pot files - and it's a requirement that translaters without developer-knowledge can then go into that web gui, translate the files and somehow synchronize the resulting .po files back into the git repo.
I'm thinking to have a jenkins job that runs before the current one we have, which only job is to run the script for generating .pot files and then commit + push them back into our development branch - and then have the web gui "check" these .po files for each language.
However, this feels kinda hack-ish, and some better solution might exist :-)
I ended up pulling/pushing translations from our GitHub project 3 times daily w/ POEditor.com's API - but I havn't yet automated the generation of the .pot files, so that's manually for now.
Don't know if we're gonna implement pre-commit git hook, or implement a pre-production build in Jenkins checking it :-)

Categories