PHP Yii::getRootAlias Examples

PHP Yii::getRootAlias - 2 examples found. These are the top rated real world PHP examples of Yii::getRootAlias extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
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
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"));