Yii-Booster

Ciao a tutti,

dopo ver installato yii-bootstrap ed essere riuscito a far andare tutto (componente + tema) adesso ho la necessità di utilizzare un widget (select2) che però non è compreso nel pacchetto di yii-bootstrap ma in YiiBooster.

da quello che ho capito yiibooster non è altro che yii-bootstrap arricchito di widget, è corretto?

Visto ciò scarico YiiBooster, lo installarlo seguo le indicazioni di setup presenti in questa pagina: yii-booster.clevertech.biz/getting-started.html#configuration (nn mi fa inserire il link)

(Elimino la vecchia installazione di yii bootstrap, copio yiibooster rinominandolo in bootstrap ottenendo questa struttura

protected/

└── extensions

    └── bootstrap


        ├── assets


        │   ├── css


        │	├── img


        │	├── js


        │	└── less


        ├── components


        │		Bootstrap.php


        └── widgets


            └── input

poi modifico il file di config.

Finita la configurazione apro l’applicazione e mi accorgo che con il tema “themes” che compreso nel plugin yii-bootstrap non va più neanche la pagina index e continuo ad avere errori del tipo "Alias “bootstrap.widgets.TbHeroUnit” is invalid. - Bootstrap and its behaviors do not have a method or closure named “register”

Su una pagina che contiene un form form ottengo "Alias "bootstrap.widgets.TbActiveForm".

Provo a cambiare tema e a rimettere quello di default e l’index ricomincia a funzionare (ovviamente la il views che richiama il widget di bootstrap non funziona)

Rimetto il tema di boostrap e mi da l’errore Yii::app()->bootstrap->register();, apro il file main.php, elimino Yii::app()->bootstrap->register(); e finalmente l’app funziona però non mi carica i css di boostrap…

Cosa sto sbagliando? I percorsi sembrano tutti corretti, il file di config idem… sugerimenti?

Il mio scopo è quello di usare il template standard di bootstrap e l’estensione yiibooster.

questo è il mio file di config


<?php


// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','path/to/local-folder');

//Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');


// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'testApp',

        'theme'=>'theme', // requires you to copy the theme under your themes directory

	// preloading 'log' component

	'preload'=>array('log, bootstrap'),


	// autoloading model and component classes

	'import'=>array(

		'application.models.*',

		'application.components.*',

                'application.modules.user.models.*',

                'application.modules.user.components.*',

	),


	'modules'=>array(

            'attivita',

		// uncomment the following to enable the Gii tool

            'user'=>array(

                       # encrypting method (php hash function)

                       'hash' => 'md5',


                       # send activation email

                       'sendActivationMail' => true,


                       # allow access for non-activated users

                       'loginNotActiv' => false,


                       # activate user on registration (only sendActivationMail = false)

                       'activeAfterRegister' => false,


                       # automatically login from registration

                       'autoLogin' => true,


                       # registration path

                       'registrationUrl' => array('/user/registration'),


                       # recovery password path

                       'recoveryUrl' => array('/user/recovery'),


                       # login form path

                       'loginUrl' => array('/user/login'),


                       # page after login

                       'returnUrl' => array('/user/profile'),


                       # page after logout

                       'returnLogoutUrl' => array('/user/login'),

                   ),


            

		'gii'=>array(

                    'generatorPaths'=>array(

                            'bootstrap.gii',

                        ),

			'class'=>'system.gii.GiiModule',

			'password'=>'ciao',

			// If removed, Gii defaults to localhost only. Edit carefully to taste.

			'ipFilters'=>array('127.0.0.1','::1'),

		),

		

	),


	// application components

	'components'=>array(

        'bootstrap' => array(

	    'class' => 'ext.bootstrap.components.Bootstrap',

	    'responsiveCss' => true,

	),

            

        'user'=>array(

                // enable cookie-based authentication

                'class' => 'WebUser',

                'allowAutoLogin'=>true,

                'loginUrl' => array('/user/login'),

            ),

		// uncomment the following to enable URLs in path-format

		/*

		'urlManager'=>array(

			'urlFormat'=>'path',

			'rules'=>array(

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',

				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

			),

		),

		

		'db'=>array(

			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',

		),*/

		// uncomment the following to use a MySQL database

		

		'db'=>array(

			'connectionString' => 'mysql:host=localhost;dbname=yiiapp2',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => '***',

			'charset' => 'utf8',

                        'tablePrefix' => 'tbl_',

		),

		

		'errorHandler'=>array(

			// use 'site/error' action to display errors

			'errorAction'=>'site/error',

		),

		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CFileLogRoute',

					'levels'=>'error, warning',

				),

				// uncomment the following to show log messages on web pages

				/*

				array(

					'class'=>'CWebLogRoute',

				),

				*/

			),

		),

	),


	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']

	'params'=>array(

		// this is used in contact page

		'adminEmail'=>'info@admin.it',

	),

);

grazie a tutti!!!

cambia il tuo preload in:


'preload'=>array('bootstrap','log')

hai ragione, mi sono perso in un bicchier d’acqua.

Grazie mille!!!

avuto stesso problema, risolto ;) grazie!!!