Пример #1
0
 /**
  * CCUrl::to with retain
  */
 public function test_to_retain()
 {
     // fake some data
     CCIn::instance(new CCIn_Instance(array('foo' => 'bar', 'view' => 'detail'), array(), array(), array(), array('HTTP_HOST' => 'clancats.com')));
     $this->assertEquals('http://clancats.com/test/?foo=batz&view=detail', CCUrl::full('test/', array('foo' => 'batz'), true));
     $this->assertEquals('/foo/?foo=bar&view=detail', to('foo/', array(), true));
     $this->assertEquals('/url/test/alias?foo=bar&view=detail', CCUrl::alias('url.test', array(), true));
 }
Пример #2
0
 public function __construct($params = null)
 {
     if ($params !== null && is_array($params)) {
         if (array_key_exists("from", $params)) {
             from($params["from"]);
         } elseif (array_key_exists("to", $params)) {
             to($params["to"]);
         } elseif (array_key_exists("header", $params)) {
             header($params["header"]);
         } elseif (array_key_exists("text", $params)) {
             text($params["text"]);
         } elseif (array_key_exists("subject", $params)) {
             subject($params["subject"]);
         }
     }
     return $this;
 }
Пример #3
0
?>
" value="create-version">Create Version from This Version</option>
                    <option value="update-template">Update This Versions Template</option>
                    @if($version->status != 'live')
                        @if(is_null($version->preview_hash))
                            <option data-dvs-url="<?php 
echo route('dvs-toggle-page-version-share', $version->id);
?>
" value="toggle-sharing">Enable Sharing</option>
                        @else
                            <option data-dvs-url="<?php 
echo route('dvs-toggle-page-version-share', $version->id);
?>
" value="toggle-sharing">Disable Sharing</option>
                            <option data-dvs-url="<?php 
echo to($page->slug . '?page_version_share=' . urlencode($version->preview_hash));
?>
" value="preview">Preview</option>
                        @endif
                        @if(!$page->dvs_admin)
                            <option data-dvs-url="<?php 
echo route('dvs-delete-page-version', $version->id);
?>
" value="delete">Delete</option>
                        @endif
                    @endif
                </select>
            </div>

            @if ($page->ab_testing_enabled)
                <div class="dvs-ab-testing-section mt sp20" data-dvs-page-id="<?php 
Пример #4
0
<?php

/*
 *---------------------------------------------------------------
 * Router map configuration
 *---------------------------------------------------------------
 *
 * You can use this configuration to set you default application
 * routes.
 */
return array('#root' => 'Welcome', '#404' => 'Error@404', '#500' => 'Error@500', 'login' => 'Auth@sign_in', 'logout' => 'Auth@sign_out', 'join@auth.sign_up' => 'Auth@sign_up', '@auth.sign_in' => to('login/', array(':back')), '@auth.sign_out' => to('logout/', array(':fingerprint')));
Пример #5
0
					<?php 
if (ClanCats::in_development()) {
    ?>
					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dev Toolbox <b class="caret"></b></a>
						<ul class="dropdown-menu">
							<li><a href="<?php 
    echo to('dev/session/');
    ?>
">Session Sandbox</a></li>
							<li><a href="<?php 
    echo to('dev/mail/');
    ?>
">Mail Sandbox</a></li>
							<li><a href="<?php 
    echo to('dev/common/phpinfo');
    ?>
">PHP Info</a></li>
						</ul>
					</li>
					<?php 
}
?>
				</ul>
			</div><!-- /.navbar-collapse -->
			
		</div><!-- /.container-fluid -->
	</nav>
</div><!-- /#header -->

<div id="main-container" class="container">
Пример #6
0
<?php

// construction
$root = new Root();
$application = new Directory('application', $root);
$dashboard = new File('dashboard.php', $application);
// modification
$fileSystem->make($application);
$fileSystem->write('my contents', to($dashboard));
$fileSystem->move($dashboard, to($root));
$fileSystem->delete($file);
Пример #7
0
<?php

use FileSystem\Directory;
use FileSystem\File;
use FileSystem\FileSystem;
when('i want to move a file', then(apply(a(function (FileSystem $fileSystem, Directory $directory, File $file) {
    $fileSystem->move($file, to($directory));
}))));