Tuesday, March 27, 2018

Where are things in YII

Constants can be created and accessed in a controller with

const YEAR = '2018';

then accessed with

self::YEAR

In a Yii app, place constants in config/main.php

'params'=>array(
// this is used in contact page
                'year_senate'=>'2018',
),

then access it with

Yii::app()->params['year_senate']


Thursday, March 15, 2018

MAC Information

Generating sha256 on Mac

To generate a sha 256 hash on Mac OSX, use

openssl sha -sha256 file

or

shasum -a 256 file

Upgrading HTML Tidy to HTML5

The Html Tidy that shipped with MAC OSX does not support HTML5.

Get the binary from http://binaries.html-tidy.org/

Verify the sha256 hash before installing.

Adding HTML Tidy to TextWrangler

From http://www.mzoo.org/html-tidy-with-text-wrangler/

Change to
~/Library/Application Support/TextWrangler/Text Filters/

(I did not have a folder for TextWrangler, so I created one and add a Text Filters subfolder.)

Create a file named HTML Tidy.sh containing

#!/bin/sh

/usr/bin/tidy -utf8 -asxhtml -indent -wrap 100 -quiet 2> /dev/null

Restart TextWrangler and access filter from Text -> Apply Text Filter -> HTML Tidy

The last used filter will be available from the Text menu.


Followers