Rename “web” folder in Symfony 1.4

╄→гoц情女王★ 提交于 2019-12-04 10:06:26

Firstly, you don't have to rename it. You can just create a symbolic link (unless you're running windows):

ln -s web html

If you still want to change the web folder name than you could do it in your project's ProjectConfiguration class by overloading setRootDir():

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setRootDir($rootDir)
  {
    parent::setRootDir($rootDir);

    $this->setWebDir($rootDir . DIRECTORY_SEPARATOR . 'html');
  }
}

kuba's answer is along the right lines, but I think it is cleaner to use setWebDir within setup:

class ProjectConfiguration extends sfProjectConfiguration
{
    public function setup()
    {
        $this->setWebDir($this->rootDir . '/html');
    }
}

I would generally prefer not to use a symlink, because it clutters up the root folder.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!