Need mobile theme for ecommerce site

Hello all,

I have a task to implement the mobile version of our Yii based ecommerce application. I am pretty comfortable with PHP but more of a HTML/CSS guy. I have been following the Yii book tutorial to gain a better understanding of PHP and frameworks in particular.

We have a fairly complex ecommerce platform that uses Yii for the frontend and we need a mobile version. I would like to keep it as best practice as possible. We have some view elements (search fields etc.) that should not be displayed in the mobile version (typical single column mobile layout).

How can I prevent a controller from rendering a view in the mobile version? I have read that the app will check the theme folder for an equivalent view and if none is found, will render the default. This is obviously not desired here. Do I need to create empty PHP view files in the theme folder so that nothing is rendered by the controller in this case?

Cheers!

I’d be use theme, read the guide about it.

You simply create a theme for the mobile and you override all views that you have to.

For set the configuration of the theme at runtime, take a look at this wiki.

Thanks. I had already read the guide.

So, if I have a view or partial that should not be rendered in the mobile theme, should I create empty views/partials?

Is easier than you think.

When you will redo the views for the mobile theme you will not incude partial views that you don’t want.

If you want to hide entire pages, just delete the link for this pages from the mobile views.

I easier to do than to explain.

But in my catalog controller actionIndex render() is called more than once (an entire left column in a product catalog list page with search functions for example as well as the list of products in the right column). These render calls cannot be prevented without modifying the controller as far as I can see. ???