Desktop and Mobile versions with HMVC - php

I wish to create a desktop and a mobile version of a site using HMVC in CodeIgniter.
This is similar to this question:
Mobile and desktop web app with codeigniter
but differs in that my views are stored in individual module directories which makes it difficult to change only the view path as suggested.
The Question:
How do I crate a mobile version of a site using the exact same controller logic as the desktop version, but with different views while using HMVC?

$this->load->library('user_agent');
if($this->agent->is_mobile())
{
//send to mobile theme
}

Related

How to make desktop .exe of web application in Laravel or PHP?

I want to make desktop .exe of web application like laravel web application or php.
Look into PHP Desktop
https://github.com/cztomczak/phpdesktop
This project that was created to provide a way for developing native desktop GUI applications using web technologies such as PHP, HTML5, JavaScript and SQLite.
That said, Laravel is a web application framework, and is not optimized to be run as a desktop application out of the box.
I would consider something like Electron:
https://electronjs.org
To name a few of the applications created with this wrapper:
Slack
Github desktop
Atom editor
Visual studio code
...and more.
Please note that this is just a wrapper for the frontend of your application. While you can still use Laravel as a backend API for your application you would still need to build the application itself as a separate javascript frontend.
If you are familiar with VueJS that ships with Laravel you should be able to use that framework for your Electron-frontend.
A couple of tutorials that might be interesting for this approach:
https://scotch.io/tutorials/create-a-desktop-quiz-application-using-vue-js-and-electron
https://www.toptal.com/laravel/restful-laravel-api-tutorial
Making desktop .exe of Laravel application is easy!
GitHub Repository: https://github.com/laravelarticle/laravel-desktop
Download the repository & extract.
Put your Laravel application into www directory.
You can use this : https://github.com/cztomczak/phpdesktop
and then check Downloads section for more detail.
When you download this extract it on your wamp or xamp then put your code in www and check you can run your app by clicking on phpdesktop-chrome.exe its just simple.For more details you can ask any query.

Symfony Mobile detect redirection different twig

I'm developing an application with Symfony now, i need to detect user support (desktop or mobile ) and redirect with the same controllers to different templates twig views (for desktop or for mobile).
I can't use media queries, for the HTML and CSS files, i have to different folders, one for desktop files and other for mobile files.
If you haven't found a solution for your application, have you looked at suncat/mobile-detect-bundle? It has both PHP and Twig hooks.

How to organize desktop and mobile views separately (Zend Framework)

I'm already running a desktop website with views and template files. Now I would like to develop a mobile version of my website.
I've already detect smart devices by using WURFL library within my own Plugin and I inject that plugin during application initialization.
I'm using Zend ContextSwitch Helper to change the context of current view file with suffix 'mobile' like: index.mobile.phtml.
What I need to organize my existing views under separate folder for mobile like: /views/mobile/index.phtml not as /views/index.mobile.phtml (same folder).
//Add Context
$this->addContext('html', array('suffix' => 'mobile'));
Please advise me how can I tell application to search mobile views under mobile for every views.
I'm using Zend Framework 1.12 version
Your desired approach may be confusing because /views/mobile/index.phtml will refer to "mobile" controller
You may override this by simply changing the template path destination for mobile templates. $view->setScriptPath('mobile')
Another way is to store them in the same folder but with different suffix /views/controller-name/action-name.mobile.phtml
You can achieve this just by changing the view extension using view renderer. $viewRenderer->setViewSuffix('mobile.phtml');
Or you may rewrite your templates using responsive webdesign :-)

How to convert drupal php code into Core PHP code?

I have one web application using drupal.Now i am trying to make the same application in to android application. So I need to convert the drupal php files into core php file
Is it possible or can I use the same drupal php files into my android application
Please anyone help me in this because i have less idea in PHP and drupal
First, if I understood you correctly, you are wanting to write up your drupal project so it can be accessed from mobile. Let me assure you, you generally do not need to rewrite much to have drupal accessible on mobile. Of course this would not be a native app, but many themes have great built-in mobile support. see [this list for a few examples].
Themes like adaptive and corolla makes it quite a breeze to push mobile content.
To recap, you would need to have:
Your site hosted on a webserver
Your drupal site fitted with a mobile / adaptive / responsive theme.
And you would be able to access your project from mobile.

Existing Joomla website - How to implement Mobile Theme + Functionality?

I need to create a mobile website for a Joomla website that is already live and running (has been for a while). I have no experience in using Joomla, so hence why I am asking you Guru's on here! I need to be able to display news and their categories, and possibly a few sub pages of cut down text from the full site.
I have found a few Joomla Extensions which hint at redirecting users to a mobile theme.
See:
Mobile Joomla!
Architect for Joomla
Do these include a mobile theme with them? Or do you have to manually create a separate theme for these extensions to identify and use when a mobile device or tablet is visiting the website? If so - can any of you direct me to the best possible route of implementing a "simple" mobile theme based on the current website? And note any common pitfalls + issues.
The website in question is here.
I look forward to your answers - thanks!
Due to the fact that a mobile version (if optimized for mobile devices) looks quite different to a normal website, I would write my own code which accesses the joomla database. For example, you create an own subdomain (no need to check "show mobile version" on every page) and there you can create a very lean and fast php/html5 version, for example. The php accesses the joomla database and gets all the news you need. Writing your own code has some advantages (in imho):
You can create a lean and dedicated version specific for your needs -> less code which handles generic things is needed
You can use some sophisticated gui-tools like iScroll to create a nice gui
I don't think that there's a great community for mobile joomla websites...

Categories