Skip to content

An automatic api.bootswatch.com fetch mechanism for CakePHP 2.0 apps

Notifications You must be signed in to change notification settings

SourceKettle/TwitterBootswatchHelper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TwitterBootswatchHelper

An automatic api.bootswatch.com fetch mechanism for CakePHP 2.0 apps

Installation

Firstly, check out TwitterBootswatchHelper into your 'APP/app/Plugin' directory and update the submodules:

$ cd app/Plugin/
$ git clone git@github.com/pwhittlesea/TwitterBootswatchHelper TwitterBootswatch

Secondly, add TwitterBootswatchHelper to your APP/app/Config/bootstrap.php config file:

<?php
...
CakePlugin::load('TwitterBootswatch');
...

Thirdly, import the Plugin in your controller:

<?php
/**
 * DemoController
 * For a demo
 *
 */
class DemoController extends AppController {
  public $helpers = array('TwitterBootswatch');
  ...
}

Finally, you can now use the TwitterBootswatch Helper in your views:

<h3>Select your theme</h3>
<?php
  $themes = array();
  foreach ($this->TwitterBootswatch->getThemes() as $a => $theme) {
    $themes[$a] = $theme['name'].' '.$theme['description'];
  }
?>
<?= $this->Form->radio("theme", $themes) ?>

About

An automatic api.bootswatch.com fetch mechanism for CakePHP 2.0 apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%