This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The base view from which all Customer module views inherit. | |
*/ | |
class MyProjectCustomerBaseView extends TallimestariBaseView | |
{ | |
public function setupHtml(AgaviRequestDataHolder $rd, $layoutName = null) | |
{ | |
parent::setupHtml($rd, $layoutName); | |
$this->getLayer('content')->setSlot('mainmenu', $this->createSlotContainer( | |
'Customer', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ServiceQuery::create() | |
->join('ServiceWeb', 'INNER JOIN') | |
->join('ServiceWeb.ServiceWebDomain', 'LEFT JOINT') | |
->join('ServiceWeb.ServiceWebHosting', 'LEFT JOIN') | |
->withColumn('COUNT(DISTINCT(ServiceWeb.ID))', 'accounts') | |
->withColumn('COUNT(DISTINCT(ServiceWebDomain.ID))', 'domains') | |
->withColumn('COUNT(DISTINCT(ServiceWebHosting.ID)), 'hosting') | |
->select(array('accounts', 'domains', 'hosting')) | |
->find(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = new DateTime(); | |
$end = new DateTime("+1 month"); | |
echo $end->setTime(0,0,0)->diff($start->setTime(0,0,0))->format("%d"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<validator class="isset" provides="foo_set" required="false"> | |
<arguments base="foos[]"> | |
<argument /> | |
</arguments> | |
</validator> | |
<validator class="number" depends="foos[%2$s][foo_set]"> | |
<arguments base="bars[]"> | |
<argument /> | |
</arguments> | |
</validator> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xi:include href="%core.app_dir%/config/routing.%locale%.xml" xmlns:xi="http://www.w3.org/2001/XInclude"> | |
<xi:fallback> | |
<routes> | |
<!-- default routes --> | |
</routes> | |
</xi:fallback> | |
</xi:include> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function executeHtml(AgaviRequestDataHolder $rd) { | |
$this->setupHtml($rd); | |
$this->setAttribute('foo', 'bar'); | |
//dom something complicated | |
} | |
public function executeAJAX(AgaviRequestDataHolder $rd) { | |
$this->setupHtml($rd); | |
$this->setAttribute('foo', 'bar'); | |
//dom something complicated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(this).find('form').submit(function() { | |
$.post($(this).attr('action'), $(this).serialize(), $this._handleSearchResult, 'json') | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = { | |
someMethod: function() { | |
var $this = this; | |
$this.someForm.submit(function() { | |
$.post($(this).attr('action'), $(this).serialize(), $this._handleSearchResult, 'json'); | |
return false; | |
}); | |
}, | |
_handleSearchResult: function(data) { | |
//do something but have to access the widget here. this is just an ajax callback object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == "https") { | |
$_SERVER['SERVER_PORT'] = 443; | |
$_SERVER['HTTPS'] = 'on'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array(31) { | |
["SCRIPT_URL"]=> | |
string(9) "/test.php" | |
["SCRIPT_URI"]=> | |
string(31) "http://foo.domain.tld/test.php" | |
["HTTP_HOST"]=> | |
string(15) "foo.domain.tld" | |
["HTTP_CONNECTION"]=> | |
string(10) "keep-alive" | |
["HTTP_ACCEPT"]=> |