1
votes

Ok, i'm trying to use the Slywalker plugin for Bootstrap, implemented in Cakephp. Link -> https://github.com/slywalker/cakephp-plugin-boost_cake

I followed the steps as specified. I downloaded the zip file, renamed the folder to "BoostCake" and placed into the plugins folder, enabled the plugin in bootstrap.php file, and it just does not work! It's making me go crazy!

I then tried to put some additional stuff in, like putting this into the composer.json (composer.json which came with the plugin) ->

{ "require": { "slywalker/boost_cake": "*" } }

And i put this in the AppController ->

class AppController extends Controller {

public $helpers = array(
    'Session',
    'Html' => array('className' => 'BoostCake.BoostCakeHtml'),
    'Form' => array('className' => 'BoostCake.BoostCakeForm'),
    'Paginator' => array('className' => 'BoostCake.BoostCakePaginator'),
);

     public $components = array(
    'Auth' => array(
        'flash' => array(
            'element' => 'alert',
            'key' => 'auth',
            'params' => array(
                'plugin' => 'BoostCake',
                'class' => 'alert-error'
            )
        )
    )
);

} My php version is upto date, and i am using Cakephp 2.4.6 Can someone please tell me what the hell is going wrong?! Many thanks in advance!

1

1 Answers

2
votes

Ok, i found the solution myself. It's very silly actually.

In your Layout/default.ctp file, you need to add some things in your header. Below is my full header. Hope it helps someone who is stuck like i was, cheers!

Please include doctype html in the beginning of the file!

    <?php echo $this->Html->charset(); ?>
    <title>
        <?php echo 'xxx' ?>:
        <?php echo $title_for_layout; ?>
    </title>
    <?php
    echo $this->Html->meta('icon');
    echo $this->Html->css('bootstrap.min');

    echo $this->fetch('meta');
    echo $this->fetch('css');
    echo $this->fetch('script');
    ?>

    <?php echo $this->Html->script("jquery.min") ?>
    <?php echo $this->Html->script("bootstrap.min") ?>
    <?php echo $this->Html->script("knockout-3.0.0") ?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
    <!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
    <!--script src="js/less-1.3.3.min.js"></script-->
    <!--append �#!watch� to the browser URL, then refresh the page. -->

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <?php echo $this->Html->script("html5shiv"); ?>
    <![endif]-->  
</head>