Yii Framework Forum: Tellibus.com, Now On Yii :) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Tellibus.com, Now On Yii :) As the saying goes... Rate Topic: -----

#1 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,168
  • Joined: 05-January 12
  • Location:Morocco

Posted 17 May 2013 - 01:59 PM

There should be an equivalent in your language to our local proverb that goes like "the butcher is having turnip at dinner" :)

We've finally released our company's website on Yii, including a blog and a mobile version.

On the app part, it's really based on the blog demo, so we didn't need any fancy extension.

We're using a slightly-adapted 960.gs 12-column grid, Font Awesome font for icons, and quite a bunch of front-end optimization techniques that we've learned over the time. On the back-end, it's a normal Linux-based shared host, with no back-end optimization till now.

The mobile version is a one-column custom —but not separate— one, meaning that the controllers and the views serve slightly adapted content, of course on the front-end, CSS is different from the desktop version, more or less like RESS, but not entirely, as it's not responsive web design, images and other inline stuff are responsive though.

In the mobile version, we serve Zepto instead of jQuery, and so have adapted (and pushed to Github) some jQuery plugins, included some used by Yii.

Our credo is also WPO:

Attached File  GTmetrix-report-tellibus.com-20130517T102137-nSWgwZTH-full.png (195.91K)
Number of downloads: 30

Full report: http://gtmetrix.com/...us.com/nSWgwZTH

Cheers!

A. Bennouna

PS Loving Yii more and more!
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,085
  • Joined: 16-February 11
  • Location:Japan

Posted 17 May 2013 - 08:52 PM

View Postbennouna, on 17 May 2013 - 01:59 PM, said:

There should be an equivalent in your language to our local proverb that goes like "the butcher is having turnip at dinner" :)

We say "the dyer is wearing écru pants" in Japanese. :)

Quote


Great!
How do you minify the outputs?
0

#3 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,168
  • Joined: 05-January 12
  • Location:Morocco

Posted 17 May 2013 - 11:51 PM

Nice saying!

Static resources (ie all external css, js, webfonts) are minified and compressed beforehand and stored in minified and min+gz versions, the .htaccess makes sure to serve the gz if supported by the browser, with the correct type mapping, mind you.

HTML is minified by overriding the render() method in the Controller's base class, and adding a regex to remove unnecessary spaces. I've found such scenario for sure on the forum.

I'm on my mobile now. But I can post that code when I access my laptop.
0

#4 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,168
  • Joined: 05-January 12
  • Location:Morocco

Posted 19 May 2013 - 03:38 PM

View Postbennouna, on 17 May 2013 - 11:51 PM, said:

HTML is minified by overriding the render() method in the Controller's base class, and adding a regex to remove unnecessary spaces. I've found such scenario for sure on the forum.


So it basically goes like that:
public function render($view, $data = null, $return = false)
{
    $output = parent::render($view, $data, true);
 
    $replace = array(
        "#(?!\<\!--\[if)(<!--.*?-->)#s" => ""  ,  // strip comments except IE conditionals, which I use to load html5shiv or Google ChromeFrame
        "#> +<#"                        => "> <", // strip excess whitespace
        "#\s*\n\s*<#"                   => "<" ,  // strip excess whitespace
        "#>\s*\n\s*#"                   => ">" ,  // strip excess whitespace
    );
 
    $search = array_keys($replace);
    $html = preg_replace($search, $replace, $output);
    $output = trim($html);

    if ($return) {
        return $output;
    } else {
        echo $output;
    }
}


I've kept a note saying that "inspiration came from reading the following links":

1

#5 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,085
  • Joined: 16-February 11
  • Location:Japan

Posted 19 May 2013 - 09:05 PM

Thank you for sharing a valuable tip!! :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users