本文整理汇总了PHP中Prado::getPathOfAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP Prado::getPathOfAlias方法的具体用法?PHP Prado::getPathOfAlias怎么用?PHP Prado::getPathOfAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prado
的用法示例。
在下文中一共展示了Prado::getPathOfAlias方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editRow
public function editRow($sender, $param)
{
if ($this->IsValid) {
$finder = CatalogueRecord::finder();
$finder->DbConnection->Active = true;
$transaction = $finder->DbConnection->beginTransaction();
try {
$rows = $finder->findBycat_id($this->getRequest()->itemAt("id"));
$rows->MasterName = TPropertyValue::ensureString($this->Name->getSafeText());
$rows->ShortName = TPropertyValue::ensureString($this->ShortName->getSafeText());
$baseMethod = new BaseFunction();
$d = dir($baseMethod->UploadFilePath);
while ($entry = $d->read()) {
if (strlen($entry) > 2 && is_file($d->path . '/' . $entry) && $entry != '.htaccess') {
copy($baseMethod->UploadFilePath . $entry, Prado::getPathOfAlias('UserFiles') . '/Language/' . $this->getRequest()->itemAt("id") . '/' . $entry) or die("Błąd przy kopiowaniu");
$rows->Photo = $entry;
}
}
$d->close();
$rows->save();
$transaction->commit();
$this->Response->redirect($this->Service->constructUrl("Language.Index", array("id" => $this->getRequest()->itemAt("id"))));
} catch (Exception $e) {
$transaction->rollBack();
}
}
}
示例2: fileDelete
public function fileDelete($sender, $param)
{
if ($this->pathName[1] == 'Index') {
FilesRecord::finder()->deleteByID($param->CommandName);
unlink(Prado::getPathOfAlias('UserFiles') . '/' . $this->pathName[0] . '/' . $this->getRequest()->itemAt("id") . '/' . $param->CommandParameter);
}
$this->Response->redirect($this->Service->constructUrl($this->pathName[0] . ".Index", array("id" => $this->getRequest()->itemAt("id"))));
}
示例3: importZendNamespace
protected function importZendNamespace()
{
if (is_null(Prado::getPathOfAlias('Zend'))) {
$zendBase = !is_null($this->_ZF) ? $this->_ZF . '.*' : 'Application.index.*';
$path = !is_null($this->_ZF) ? $this->_ZF . '.Zend.*' : 'Application.index.Zend.*';
Prado::using($zendBase);
Prado::setPathOfAlias('Zend', Prado::getPathOfNamespace($path));
}
}
示例4: editRow
public function editRow($sender, $param)
{
if ($this->IsValid) {
$short = strtolower($this->ShortName->getSafeText());
$rows = new CatalogueRecord();
$rows->name = 'messages.' . $short;
$rows->MasterName = TPropertyValue::ensureString($this->Name->getSafeText());
$rows->ShortName = TPropertyValue::ensureString($short);
$rows->save();
if (!is_dir(Prado::getPathOfAlias('UserFiles') . '/Language/' . $rows->cat_id)) {
$dirun = dir(Prado::getPathOfAlias('UserFiles'));
mkdir($dirun->path . '/Language/' . $rows->cat_id, 0775);
$dirun->close();
}
$baseMethod = new BaseFunction();
$d = dir($baseMethod->UploadFilePath);
while ($entry = $d->read()) {
if (strlen($entry) > 2 && is_file($d->path . '/' . $entry) && $entry != '.htaccess') {
copy($baseMethod->UploadFilePath . $entry, Prado::getPathOfAlias('UserFiles') . '/Language/' . $rows->cat_id . '/' . $entry) or die("Błąd przy kopiowaniu");
$row = CatalogueRecord::finder()->findBycat_id($rows->cat_id);
$row->Photo = $entry;
$row->save();
}
}
$statyczne = PagesRecord::finder()->findAll('PageID IS NULL AND LanguageID = 1');
foreach ($statyczne as $page) {
$new = new PagesRecord();
$new->Name = $rows->ShortName . ' : ' . $page->Name;
$new->LanguageID = $rows->cat_id;
$new->LangCode = $short;
$new->PageID = $page->PageID;
$new->Protected = $page->Protected;
$new->Position = $page->Position;
$new->ShowMenu = $page->ShowMenu;
$new->save();
}
$translation = TransUnitRecord::finder()->findAll('cat_id = 1');
foreach ($translation as $page) {
$new = new TransUnitRecord();
$new->id = $page->id;
$new->cat_id = $rows->cat_id;
$new->source = $page->source;
$new->save();
}
$settings = SettingsRecord::finder()->findAll('LanguageID = 1');
foreach ($settings as $set) {
$newS = new SettingsRecord();
$newS->Key = $set->Key;
$newS->Value = $rows->ShortName . ' : ' . $set->Value;
$newS->LanguageID = $rows->cat_id;
$newS->LangCode = $short;
$newS->save();
}
$this->Response->redirect($this->Service->constructUrl("Language.Index", array('id' => $rows->cat_id)));
}
}
示例5: testSetTransformPathAsNamespace
public function testSetTransformPathAsNamespace()
{
if (Prado::getPathOfAlias('UnitTest') === null) {
Prado::setPathOfAlias('UnitTest', dirname(__FILE__) . '/data');
}
$expected = $this->transformPath;
$transform = new TXmlTransform();
$transform->setTransformPath('UnitTest.hello');
$this->assertEquals($expected, $transform->getTransformPath());
}
示例6: clearTempFile
public function clearTempFile()
{
$d = dir(Prado::getPathOfAlias('UserFiles'));
while ($entry = $d->read()) {
if (strlen($entry) > 2 && is_file($d->path . '/' . $entry)) {
unlink(Prado::getPathOfAlias('UserFiles') . '/' . $entry);
}
}
$d->close();
$f = dir('themes/Admin/jQuery-File-Upload/server/php/files/');
while ($entry = $f->read()) {
if (strlen($entry) > 2 && is_file($f->path . '/' . $entry) && $entry != '.htaccess') {
unlink($f->path . '/' . $entry);
}
}
$f->close();
$g = dir('themes/Admin/jQuery-File-Upload/server/php/files/thumb/');
while ($entry = $g->read()) {
if (strlen($entry) > 2 && is_file($g->path . '/' . $entry) && $entry != '.htaccess') {
unlink($g->path . '/' . $entry);
}
}
$g->close();
}