PHP Method Yii::getRootAlias Code Examples

This page contains top rated real world PHP examples of method Yii::getRootAlias extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: BatchController.php Project: ICHydro/anaconda
0
 /**
  * Helper function to create
  *
  * @param $ns Namespace
  */
 private function createDirectoryFromNamespace($ns)
 {
     echo \Yii::getRootAlias($ns);
     $dir = \Yii::getAlias('@' . str_replace('\\', '/', ltrim($ns, '\\')));
     @mkdir($dir);
 }
Example #2
Show file File: test.php Project: zekang/pi_yii
0
<?php

class A extends yii\base\Object
{
    public function setName()
    {
        return 1;
    }
}
$a = new A();
var_dump($a->name);
exit;
//sleep(20);
ini_set('my_yii.yii_path', __DIR__);
Yii::init();
//var_dump(Yii::$aliases);
var_dump(Yii::getAlias("@yii/dfdd/adfd/test.php12323232"));
exit;
Yii::$aliases = ['@app' => ['@app/homedd' => 'app/homedd', '@app/home' => 'app/home']];
var_dump(Yii::getRootAlias("@app/home/abc.txt"));