本文介绍了Yiistrap 配置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让 Yiistrap(Yii 框架的引导程序)在 Cent OS 6.5 上工作.我已将 yiistrap-master 解压到 extensions/bootstrap 并将以下内容添加到 protected/config/main.php:

I am trying to get Yiistrap (Bootstrap for the Yii Framework) to work on Cent OS 6.5. I've unpacked the yiistrap-master into extensions/bootstrap and added the following to protected/config/main.php:

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// CWebApplication properties can be configured here.
return array(
    'aliases'=>array(
    'bootstrap'=>'/var/www/html/happytails/protected/extensions/bootstrap'
    ),

 'import'=>array (
    'bootstrap.helpers.TbHtml',

  'components'=>array(
            'bootstrap'=>array(
            'class'=>'bootstrap.components.TbApi'
            ),

我还在protected/views/layouts/main.php中添加了注册功能

I also added the register function onto protected/views/layouts/main.php

<?php /* @var $this Controller */ ?>
<?php Yii::app()->bootstrap->register(); ?>

这应该可行,但我一直遇到错误:

This should work but I keep running into the error:

别名bootstrap.components.TbApi"无效.确保它指向一个现有的 PHP 文件并且该文件是可读的.

文件在那里并且可读.我不确定可能是什么问题.

File is there and readable. I am not sure what could be the issue.

[root@unknown000c29a635f6 extensions]# ls -l
total 4
drwxrwxrwx. 10 nobody nobody 4096 Feb  5 01:50 bootstrap

`[root@unknown000c29a635f6 bootstrap]# ls -l
total 112
drwxrwxrwx. 6 nobody nobody  4096 Feb  5 01:50 assets
drwxrwxrwx. 2 nobody nobody  4096 Feb  5 01:50 behaviors
-rwxrwxrwx. 1 nobody nobody   296 Jan 29 14:40 codeception.yml
drwxrwxrwx. 2 nobody nobody  4096 Feb  6 20:29 components
-rwxrwxrwx. 1 nobody nobody  1075 Jan 29 14:40 composer.json
-rwxrwxrwx. 1 nobody nobody 54859 Jan 29 14:40 composer.lock
drwxrwxrwx. 2 nobody nobody  4096 Feb  5 01:50 form
drwxrwxrwx. 3 nobody nobody  4096 Feb  5 01:50 gii
-rwxrwxrwx. 1 nobody nobody   555 Jan 29 14:40 Gruntfile.js
drwxrwxrwx. 2 nobody nobody  4096 Feb  5 01:50 helpers
-rwxrwxrwx. 1 nobody nobody  1521 Jan 29 14:40 LICENSE.txt
-rwxrwxrwx. 1 nobody nobody   604 Jan 29 14:40 package.json
-rwxrwxrwx. 1 nobody nobody   370 Jan 29 14:40 README.md
drwxrwxrwx. 6 nobody nobody  4096 Feb  5 01:50 tests
drwxrwxrwx. 2 nobody nobody  4096 Feb  5 01:50 widgets`

非常感谢您在此主题上提供的任何帮助.

Thank you very much for any help you can provide on this subject.

推荐答案

使用 Yiistrap 1.3.0 我必须执行以下操作:

With Yiistrap 1.3.0 I had to do the following:

'import' => array(
    'bootstrap.helpers.TbHtml',
    'bootstrap.helpers.TbArray',
    'bootstrap.behaviors.TbWidget',
    'bootstrap.widgets.*'
)

这篇关于Yiistrap 配置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 13:33