Yii Framework Forum: Bootstrap Yii e Less - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Bootstrap Yii e Less Rate Topic: -----

#1 User is offline   Hebert Porto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-January 11

Posted 03 August 2012 - 10:24 AM

Pessoal,

Estou tentando usar essa extension de bootstrap : http://www.yiiframew...nsion/bootstrap
e essa de less : http://www.yiiframew.../extension/less

Segui o setup da maneira como indicam nas extensions, mas estou sem orientação para descobrir o que há de errado. Depois de configurar o main.php e tentar acessar a aplicação sempre encontro esse erro: Property "CWebUser.less" is not defined.

Então, alguém aqui que já usou e sabe configurar pode me passar uma orientação ?

Vlws
0

#2 User is offline   Müller 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 23-June 12
  • Location:Netherlands

Posted 03 August 2012 - 11:44 AM

Coloque o seu main.php aqui para podermos ajudar

View PostHebert Porto, on 03 August 2012 - 10:24 AM, said:

Pessoal,

Estou tentando usar essa extension de bootstrap : http://www.yiiframew...nsion/bootstrap
e essa de less : http://www.yiiframew.../extension/less

Segui o setup da maneira como indicam nas extensions, mas estou sem orientação para descobrir o que há de errado. Depois de configurar o main.php e tentar acessar a aplicação sempre encontro esse erro: Property "CWebUser.less" is not defined.

Então, alguém aqui que já usou e sabe configurar pode me passar uma orientação ?

Vlws

0

#3 User is offline   Hebert Porto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-January 11

Posted 03 August 2012 - 12:07 PM

Opa !

Esse aqui é o meu main.php

<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Bootstrap and Less',
                
	// preloading 'log' component
	'preload'=>array(
                                'log',
                                'less',
                                'bootstrap', // preload the bootstrap component
                               
                ),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'123456',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			//'ipFilters'=>array('127.0.0.1','::1'),
                                            
                                                'generatorPaths' => array(
                                                                                 'bootstrap.gii', // since 0.9.1
                                                ),
		),
		
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
                               
                               'less'=>array(
                                        'class'=>'ext.less.components.LessCompiler',
                                        'paths'=>array(
                                                'protected/extensions/bootstrap/lib/bootstrap/less/bootstrap.less' => 'protected/extensions/bootstrap/assets/css/bootstrap.min.css',
                                                'protected/extensions/bootstrap/lib/bootstrap/less/responsive.less' => 'protected/extensions/bootstrap/assets/css/bootstrap-responsive.min.css',
                                        ),
		),
                        
                                'bootstrap'=>array(
                                                                'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
                                                        ),
                        ),

[ ... ]


0

#4 User is offline   Gustavo Andrade 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 95
  • Joined: 16-August 11
  • Location:MG

Posted 03 August 2012 - 12:27 PM

O meu ta igual o seu, porem o import ta assim aki:

'import'=>array(
		'application.models.*',
		'application.components.*',
                'application.extensions.*',


e descompactei a extensao em:

protected\extensions\bootstrap


Assim funcionou, mas so uso o bootstrap.
0

#5 User is offline   Müller 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 23-June 12
  • Location:Netherlands

Posted 03 August 2012 - 05:03 PM

Olha no código abaixo o comentário: //FALTOU FECHAR ESSE PARENTESES

'components'=>array(
    'user'=>array(
       // enable cookie-based authentication
       'allowAutoLogin'=>true,
    ), //FALTOU FECHAR ESSE PARENTESES
    'less'=>array(
        'class'=>'ext.less.components.LessCompiler',
        'paths'=>array(
            'protected/extensions/bootstrap/lib/bootstrap/less/bootstrap.less' => 'protected/extensions/bootstrap/assets/css/bootstrap.min.css',
            'protected/extensions/bootstrap/lib/bootstrap/less/responsive.less' => 'protected/extensions/bootstrap/assets/css/bootstrap-responsive.min.css',
        ),
    ),
    'bootstrap'=>array(
        'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
    ),
),


Correto?

View PostHebert Porto, on 03 August 2012 - 12:07 PM, said:

Opa !

Esse aqui é o meu main.php

<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Bootstrap and Less',
                
	// preloading 'log' component
	'preload'=>array(
                                'log',
                                'less',
                                'bootstrap', // preload the bootstrap component
                               
                ),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'123456',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			//'ipFilters'=>array('127.0.0.1','::1'),
                                            
                                                'generatorPaths' => array(
                                                                                 'bootstrap.gii', // since 0.9.1
                                                ),
		),
		
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
                               
                               'less'=>array(
                                        'class'=>'ext.less.components.LessCompiler',
                                        'paths'=>array(
                                                'protected/extensions/bootstrap/lib/bootstrap/less/bootstrap.less' => 'protected/extensions/bootstrap/assets/css/bootstrap.min.css',
                                                'protected/extensions/bootstrap/lib/bootstrap/less/responsive.less' => 'protected/extensions/bootstrap/assets/css/bootstrap-responsive.min.css',
                                        ),
		),
                        
                                'bootstrap'=>array(
                                                                'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
                                                        ),
                        ),

[ ... ]



0

#6 User is offline   Hebert Porto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 27-January 11

Posted 03 August 2012 - 06:12 PM

Opa !! vlws era isso mesmo.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users