I have googled and searched SO for the title above but didn't get much help. I am new on backend side (usually working on frontend), and my boss suddenly want to use Parse for our backend. My questions are:
Is it possible to use it with CodeIgniter? A friend of mine suggested to discard CodeIgniter if I use Parse.
If it is possible, do I just need to make a call to the API through CI's controller to post/get data?
Thanks.
Add the following lines to the head of all the pages that require Parse:
<script src="http://www.parsecdn.com/js/parse-1.2.8.min.js"></script>
In your code, before using any Parse classes, add the initialization call with your Application ID and JavaScript key:
Parse.initialize("XVRsi5WgBbUrEXNc6zfGnvNbSFDmWD9sSda2X3iP", "XeuUDEzRJGOS5NtpBdeeswdRWDu3olmuMJvO9yN2");
If you are converting an existing Backbone application to use Parse, read the conversion instructions.
https://www.parse.com/docs/js_guide#convert
Related
I am relatively new to ServiceNow, and I am building some UI pages where I basically do not need any of the SN structure except for Glide Ajax (I need to get data from a Script Include).
The problem is that when I select "Direct" the Glide Ajax functions are not available any more in the client script.
Does anybody know if this is possible to achieve? I searched everywhere without success.
Thanks a lot!
If you check "Direct", it omits all ServiceNow specific JavaScript and CSS. "GlideAjax" is ServiceNow specific JavaScript.
If the data that you are pulling back from the Script Include is static (meaning that you can pull it when the UI page is loaded) then you can probably do it inside an "evaluate" block in the HTML section of the UI page. You could have your Script Include return a JSON object as a string and store it in a variable. Then you could have your client JavaScript parse that variable. I am not a Jelly expert, so I would be curious to know if it works.
I need to develop an application get html content from certain urls and shows them in my own web app.
UI web application will be laravel 5.3 its ok. But the thing is key pointhere that retrieves data from urls(read and parse html content of via url)
and writes it to postgresql db migth be developed within laravel also ?
Before I decide to create this post I feel had to make an web service in python and read url and writes to db and read them within laravel web application. Which one is better or more efficient?
Besides them I also wonder that is possible develop such a web service in laravel
You can use ixudra/curl package. It's powerful, easy to use and you will be free to do anything you want. You can also save results into database. Make sure php-curl module installed on your php before you use this package. there is a pacakge named Guzzle and you can use that package but it's a little bit complicated than ixudra.
when you get html content from requested urls. You can parse the content with yangqi/htmldom package.
How do I share template information between my PHP backend and JavaScript / AJAX requests?
Times ago I just sent my AJAX requests and had the HTML generated by the server and sent as such. Today I have my AJAX data as JSON but I have no idea how to use the same template (e.g. a users list) at the server side and (for refreshing, filtering etc.) at client side without creating redundant layout code.
Is there a template language with parsers as well for PHP/Laravel and JavaScript?
The Laravel template engine Blade is obviously not usable in JavaScript.
The only sharing template language I found via Google was Mustache, but the parser for Laravel was outdated.
Is there anything else out there and which approach do you use for that?
Your boiled down question:
Is there a template language with parsers as well for PHP/Laravel and
JavaScript?
Laravel and Mustache | server side:
conarwelsh/mustache-l4 is a Mustache.php wrapper for Laravel 4. They seems to keep up very well as opposed to what you tell (I presume you mean michaelenger/mustacheview which is actually a Laravel 3 bundle). I stand corrected if am wrong.
Laravel's Blade doesn't rule out Mustache at all. You just have to create a Mustache partial without using blade.php extension and include it within a regular Blade template using #include (More details here)
Serving Mustache template:
You can even coin any custom Response you need using Response Macros such Response::mustache(...) leveraging Response::make(...) (see here for more details).
Some samples of interest:
Combining Laravel 4 and Backbone.
Sharing Templates Between PHP and JavaScript | PHP but still relevant!
My short answer (Updated):
Don't look elsewhere: Laravel + Mustache + Javascript if a mix of server|client side rendering is part of your requirements.
Get your hands dirty! :)
I had the same issue with Laravel and Angularjs, what I did is that I created a route to return templates http://domain.com/templates/name
This route will View::make('templates'.$name);, this is an AngularJs template that will be filled with data returned by JSON API. Remember to use non conflicting tags I used {{ for Laravel and <% for Angular.
RENDER YOUR TEMPLATE SERVER SIDE! I'm not sure at what point someone decided you needed to send JSON to the front end, but that's not how they do it in Rails. In Rails, they actually render the template server side, then send it back to the front end and your JS appends it to the page (or, actually sends back the JS + the markup to attach). This saves a ton of time and headache, trust me.
In the last 3 months, i have learnt html, css, js and php and now i'm trying to learn Framework Codeigniter. My teacher gave me a rough idea abt MVC and asked me to download a project made on codeigniter from internet and edit it.
I downloaded a login form project and tried to read it. But i'm still kind of confused how everything works. i hv 2 questions:
What is the correct approach to learn codeigniter?
In how many days one can learn codeigniter? (i practice around 6-7 hrs a day)
The best way to learn codeigniter is to read the manual of codeigniter
Because, codeigniter framework is so much popular for their well formatted and clean documentation.
Or you can check this for beginner level tutorial
Or if you want to learn codeigniter by doing practical projects then you can follow this link
I learned CI over a weekend using this technique.
Start with simply setting up a 2 page site.
Home and About Us.
Pass simple string variables from the controllers to the views.
Next, bring a model into it.
Make a method in your model that returns some plain text, to the controller and finally to the model.
Next, make the model actually make a request to your database and return the result to the constructor then view.
After that try these:
write a helper function
Try making a basic route
Log a debugging message
upload a file from a form using the upload library
That's a good grounding in CI
Keep in mind Codeigniter is no longer in development also.
If your keen on sticking with PHP, you might want to check out the similar active project called "Laravel" after getting the hang of CIs very simple MVC structure.
Good luck!
the common way is read their manual and follow the guide, the another approach is search youtube for codeigniter turial, there are many good tutorial out there and easy to follow for example here is my result in the first place for keyword "codeigniter tutorial"
https://www.youtube.com/watch?v=BP9NRZXOvIw&list=PLIQyGVrcLTeXsq37O7IBGaUwu6xEwqBWV&index=1
How to get started with CodeIgniter and Google Maps API.
I've got a CodeIgniter library specifically for this purpose. You can find more information about it here:
http://biostall.com/codeigniter-google-maps-v3-api-library
A few demos of what can be acheived using the library:
http://biostall.com/demos/google-maps-v3-api-codeigniter-library/
Give me a shout if you have any questions or need any help :)
Enjoy!
CodeIgniter is a backend (server-side) framework. Google Maps API is a frontend (client-side) library. There isn't really any specialized knowledge you need to know about CodeIgniter to get Google Maps working, other than being able to render a view. The question is somewhat flawed in that you assume one depends on the other, when in reality, they are very much decoupled.
The question is similar to how do i get jquery working with codeigniter?...
Reading the CodeIgniter documentation would be a start to understanding how to echo HTML and JavaScript to the browser. The rest is almost entirely client-side JavaScript programming.