在我的网络应用程序中,我想对Yiistrap使用x-editable。我按照以下链接“http://x-editable.demopage.ru/”中提到的步骤进行操作。我正在使用Yiistrap工作正常。但是我无法安装x-editable我收到此错误“别名”可编辑。*“无效。请确保它指向现有目录或文件。” “ 我的protected / config / main.php文件
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',
'aliases' => array(
'bootstrap' => realpath(__DIR__ . '/../extensions/bootstrap'),
'x-editable'=>realpath(__DIR__. '/../extensions/x-editable'),
),
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'bootstrap.helpers.TbHtml',
'editable.*' //easy include of editable classes
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'***',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
'generatorPaths' => array('bootstrap.gii'),
),
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// uncomment the following to enable URLs in path-format
'editable' => array(
'class' => 'editable.EditableConfig',
'form' => 'bootstrap', //form style: 'bootstrap', 'jqueryui', 'plain'
'mode' => 'popup', //mode: 'popup' or 'inline'
'defaults' => array( //default settings for all editable elements
'emptytext' => 'Click to edit'
),
),
这不是完整的代码,我必须编辑的代码,如我所遵循的教程中所述。
答案 0 :(得分:0)
关于x-editable指令:
Yii::setPathOfAlias('editable', dirname(__FILE__).'/../extensions/x-editable');
从此代码中删除x-
:
'aliases' => array(
// ...
'editable'=>realpath(__DIR__. '/../extensions/x-editable'),
),