Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a Question about prerendering a vue app built with php ( laravel or pure php it doesn't matter )
My question is how really prerendering work with dynamic content For example:
when I make a blog with vue and php to show post I make Ajax Request in my vue app.. how google bots and other web crawlers will read my site content
Thanks in advance
The concept of prerendering is most used in SPA. It consists of rendering a placeholder or dynamic elements until the JavaScript code makes the necessary Ajax requests and uses the requested data to render new elements.
You can use prerendering to server-side render the HTML that you want to make indexable for the search engines. Using PHP and Vue.js to achieve that can be complex because you need to have a view for the PHP template engine and another one for Vue.js. It can be difficult to maintain when the application grows.
I've used hypernova to achieve that (Laravel and Vue.js). I wrote a couple of articles about it
https://dev.to/phillipgd1992/universal-rendering-in-laravel-using-vue-js-and-ara-framework-5amd
https://itnext.io/strangling-a-monolith-to-micro-frontends-decoupling-presentation-layer-18a33ddf591b
You can read more about prerender, ssr, csr and universal rendering here:
https://developers.google.com/web/updates/2019/02/rendering-on-the-web#seo
Let me know if I can help you with something else.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm having a trouble on how to implement Single Page Application on Laravel blade php file format using Vue-router, is that possible?.The reference link below says that it is impossible to use SPA on php file format and I'm here to ask to confirm if this is not possible, but I guess there is other solution with this issue. It would be great if anybody could figure out, thank you so much in advance!.
Reference
For example with this file it should blade.php instead of vue
Not possible ..laravel have some standards that need to follow
Blade view files use the .blade.php file extension and are typically stored in the resources/views directory.
SPA are fast since most resources (HTML,CSSS,Scripts etc) and DOM components are only loaded once throughout the entire cycle of an application. Subsequently, only dynamic content is loaded by JS, which speeds up the site remarkably.
If you are using blade then it needs to reload for every changes to reflect then what points of using it
Refer this: https://laravel-news.com/using-vue-router-laravel
Personally I would opt for L8 with inertiajs(vuejs) which is integrated in the documentation and you can easily make a SPA
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I created an app with PhoneGap but I need to load some stuff from another domain. I tried jQuery load with a xdomainload plugin but It did not work.
The stuff I need to show run on PHP as the back-end language. I'm really noob - I've seen a few tutorials about JSON but all of them did not work and I ended giving up. Is JSON the easiest way?
Thank you all
Generally speaking, PHP wont run client-side in Cordova. If you're trying to access some sort of backend service that you built using PHP, then that's doable with JSON. Whether it's "the easiest", makes this question to open for interpretation. Generally speaking, a common approach may be to use javascript to communicate with backend services which "talk" JSON between each other. This question might get closed for being to opinion based. But that's my 2 cents.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am trying to create an application that will have some similar looking pages. I am not sure what is the best way to do this.
Each page will have a header, side bar, content and footer.
The tricky part here is the sections will be similar but not the same. For example the header can have a combobox and different pages will have different data. One page will have a textbox.
The data will come from SQL server via PHP.
What would be the best way to handle this?
If you are using PHP then take a look into http://www.h2o-template.org/ - the templates will allow you to create similar structures and keeping them maintanable most importantly.
You can then have base template which encapsulates all of the similarities and extend sub templates from that which make each page unique.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I found a similar questions, but it's not exactly what I am looking for.
I write web site using php. For dynamic content I use jQuery Ajax.
I have 20-50 functions and I want to use Ajax to call these functions and take JSON.
Idea is to pass parametres via ajax POST. Pages works with database and job is done.
The question - how better organize it?
Should I create 50 separate pages like:
mysite.com/ajax/delete_project.php
mysite.com/ajax/delete_user.php
mysite.com/ajax/show_user_info.php
mysite.com/ajax/show_my_messages.php
mysite.com/ajax/show_my_tasks.php
mysite.com/ajax/send_message.php
.......
or create one page? or maybe i am completely wrong with all of that
Ideally you should be using a framework, such as Symfony. Otherwise, I usually keep all the functions for each content type in a single file. So you might have:
mysite.com/api/blog_posts.php which would implement GET, POST, PUT, DEL, etc... for all the blog posts. Meanwhile, mysite.com/api/messages.php would handle that for all messages.
You must start using an MVC framework if not using already. I would say Laravel should be a good choice, it's easy to learn, feature-rich and fun to work with. Start looking into Laravel Routes.
Moving to MVC is the best way to start getting into shape in your case.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Assume there is a website called http://example.com/a
the website is being developed using PHP, Perl, Ruby and other languages.
I want to be able from my website to read this website pages, execute the code and then analyze the HTML result page tags and getting the content using PHP.
it's like reading news from some news websites and then displays it in my website in different format or different style.
I'm not sure you understand this aspect of web programming, but you cannot access the server-side code which generated the HTML. You can of course parse the HTML which is returned from the server by using one of many HTML parsers.
That may or may not have been what you asked, because your question is a bit vague to me. Note that if you want to collect information from other web pages on your web page, you should make sure your web site doesn't make a request to those other web pages each time a user visits your site. (Phew, that was a handful!) You need to implement some sort of caching of the other web sites' content.