Yii Framework Forum: How to config messages folder path? - Yii Framework Forum

Jump to content

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

How to config messages folder path? How to config messages folder path? Rate Topic: -----

#1 User is offline   tq0fqeu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 06-May 10

Posted 18 June 2010 - 03:26 AM

How to config messages folder path?
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 18 June 2010 - 07:39 AM

The message source path can be configured with Yii::app()->message->basePath (see CPhpMessageSource)

Or in config/main.php

'message'=>array('basePath'=>'yourPath')


You have to adjust your config/message.php accordingly
0

#3 User is offline   tq0fqeu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 06-May 10

Posted 19 June 2010 - 10:35 PM

View Postzaccaria, on 18 June 2010 - 07:39 AM, said:

The message source path can be configured with Yii::app()->message->basePath (see CPhpMessageSource)

Or in config/main.php

'message'=>array('basePath'=>'yourPath')


You have to adjust your config/message.php accordingly


Thx, but not solved, message is readonly.
0

#4 User is offline   tebe 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 18-October 10

Posted 05 December 2012 - 04:59 AM

The key "message" is not readonly, it's simply wrong.

Instead of "message" try "messages". And it has to be within "components". So it look likes this:

'components' => array(
    'messages'=>array('basePath'=>'yourPath'),
),

0

#5 User is offline   audichya 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 15-December 12

Posted 07 February 2013 - 01:22 AM

Please set the path of messages using ALIAS like :
'components' => array(
    'messages'=>array('basePath'=>Yiibase::getPathOfAlias('application.messages')),
),


Here getPathOfAlias('application.messages') will return path/to/webroot/project-folder-if/protected/messages
Please refer to the Yii Guide for more information about path aliases

You could give path directly instead of using Yiibase::getPathOfAlias(...) using php
dirname function but it will not be flexible if you change the location of your application.

Hope this will help!
0

#6 User is offline   TickTak 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 28-March 14

Posted 27 May 2014 - 09:29 AM

@up
This one:
'messages'=>array('basePath'=>Yiibase::getPathOfAlias('application.messages')),

It's return false in my config file. Anyone know how make this with the same effect ?
0

#7 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 685
  • Joined: 12-September 10
  • Location:Austria

Posted 27 May 2014 - 10:55 AM

The config/main.php will be included before the alias path's (application, ext, webroot ...) are added.
So you can't use Yii::getPathOfAlias('application.xxx') in config/main.php.

Use
realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'../yourpath')
instead.

But 'application.messages' is the default for PHPMessageSource, so you don't have to assign this path in the config file.
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