You are here

read_me.txt in Sassy 7

Requirements
============
Yii 1.0 or above

Installation
============
Extract the release file under `protected/extensions`

Usage
=====
The [PHamlP Wiki](http://code.google.com/p/phamlp/w/list) has detailed
description of options for Haml and Sass.

  Haml
  ====
  Declare PHamlP's Haml as your the viewRender component in your configuration.
  ~~~
  'viewRenderer'=>array(
    'class'=>'ext.phamlp.Haml',
    // delete options below in production
    'ugly' => false,
    'style' => 'nested',
    'debug' => 0,
    'cache' => false,
  ),
  ~~~
  In the demo folder there are Haml templates for a new Yii project. Copy them 
  into the appropriate locations in the views directory.

    View File Types
    ===============
    The extension supports the use of both Haml and PHP view files and layouts 
    in the same application, so you can swap your views to Haml gradually and 
    use extensions and widgets with .php views.

    Yii 1.1.2 and greater support this feature natively.
    For use with earlier versions of Yii the extension contains the 
    AppController file in the Yii directory. This has a new resolveViewFile() 
    method that must override CCcontroller::resolveViewFile(). This is done 
    either by extending your application's controllers from AppController (Yii 
    must be able to find it, so either move it from the extension into 
    application.components or edit your configuration file to import it), or 
    copy AppCcontroller::resolveViewFile() method into your application's own 
    base controller.

    **Note:** Prior to R0014 all views must be Haml

  Sass
  ====

  In order to make the handling of Sass files transparent the extension has an 
  enhanced asset manager. This must be declared as the assetManager component 
  in your configuration file.
  ~~~
  'assetManager' => array(
    'class' => 'PBMAssetManager',
    'parsers' => array(
      'sass' => array( // key == the type of file to parse
        'class' => 'ext.phamlp.Sass', // path alias to the parser
        'output' => 'css', // the file type it is parsed to
        'options' => array(<Parser specific options>)
      ),
    )
  ),
  ~~~

  Sass supports the .sass (indented) and the .scss (CSS style) syntaxes.
  To use both you need to tell the asset manager that both extensions are to be
  parsed with Sass.
  ~~~
  'assetManager' => array(
    'class' => 'PBMAssetManager',
    'parsers' => array(
      'sass' => array( // key == the type of file to parse
        'class' => 'ext.phamlp.Sass', // path alias to the parser
        'output' => 'css', // the file type it is parsed to
        'options' => array(<Parser specific options>)
      ),
      'scss' => array( // key == the type of file to parse
        'class' => 'ext.phamlp.Sass', // path alias to the parser
        'output' => 'css', // the file type it is parsed to
        'options' => array(<Parser specific options>)
      ),
    )
  ),
  ~~~
  
  Publishing a Sass file is the same as publishing any other asset, i.e.:
  ~~~
  $publishedAsset = Yii::app()->getAssetMananger()->publish(
    Yii::getPathOfAlias('allias.to.asset.directory').DIRECTORY_SEPARATOR.'asset.sass'
  );
  ~~~

File

phamlp/Yii/phamlp/read_me.txt
View source
  1. Requirements
  2. ============
  3. Yii 1.0 or above
  4. Installation
  5. ============
  6. Extract the release file under `protected/extensions`
  7. Usage
  8. =====
  9. The [PHamlP Wiki](http://code.google.com/p/phamlp/w/list) has detailed
  10. description of options for Haml and Sass.
  11. Haml
  12. ====
  13. Declare PHamlP's Haml as your the viewRender component in your configuration.
  14. ~~~
  15. 'viewRenderer'=>array(
  16. 'class'=>'ext.phamlp.Haml',
  17. // delete options below in production
  18. 'ugly' => false,
  19. 'style' => 'nested',
  20. 'debug' => 0,
  21. 'cache' => false,
  22. ),
  23. ~~~
  24. In the demo folder there are Haml templates for a new Yii project. Copy them
  25. into the appropriate locations in the views directory.
  26. View File Types
  27. ===============
  28. The extension supports the use of both Haml and PHP view files and layouts
  29. in the same application, so you can swap your views to Haml gradually and
  30. use extensions and widgets with .php views.
  31. Yii 1.1.2 and greater support this feature natively.
  32. For use with earlier versions of Yii the extension contains the
  33. AppController file in the Yii directory. This has a new resolveViewFile()
  34. method that must override CCcontroller::resolveViewFile(). This is done
  35. either by extending your application's controllers from AppController (Yii
  36. must be able to find it, so either move it from the extension into
  37. application.components or edit your configuration file to import it), or
  38. copy AppCcontroller::resolveViewFile() method into your application's own
  39. base controller.
  40. **Note:** Prior to R0014 all views must be Haml
  41. Sass
  42. ====
  43. In order to make the handling of Sass files transparent the extension has an
  44. enhanced asset manager. This must be declared as the assetManager component
  45. in your configuration file.
  46. ~~~
  47. 'assetManager' => array(
  48. 'class' => 'PBMAssetManager',
  49. 'parsers' => array(
  50. 'sass' => array( // key == the type of file to parse
  51. 'class' => 'ext.phamlp.Sass', // path alias to the parser
  52. 'output' => 'css', // the file type it is parsed to
  53. 'options' => array()
  54. ),
  55. )
  56. ),
  57. ~~~
  58. Sass supports the .sass (indented) and the .scss (CSS style) syntaxes.
  59. To use both you need to tell the asset manager that both extensions are to be
  60. parsed with Sass.
  61. ~~~
  62. 'assetManager' => array(
  63. 'class' => 'PBMAssetManager',
  64. 'parsers' => array(
  65. 'sass' => array( // key == the type of file to parse
  66. 'class' => 'ext.phamlp.Sass', // path alias to the parser
  67. 'output' => 'css', // the file type it is parsed to
  68. 'options' => array()
  69. ),
  70. 'scss' => array( // key == the type of file to parse
  71. 'class' => 'ext.phamlp.Sass', // path alias to the parser
  72. 'output' => 'css', // the file type it is parsed to
  73. 'options' => array()
  74. ),
  75. )
  76. ),
  77. ~~~
  78. Publishing a Sass file is the same as publishing any other asset, i.e.:
  79. ~~~
  80. $publishedAsset = Yii::app()->getAssetMananger()->publish(
  81. Yii::getPathOfAlias('allias.to.asset.directory').DIRECTORY_SEPARATOR.'asset.sass'
  82. );
  83. ~~~