本文整理汇总了PHP中Str::f方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::f方法的具体用法?PHP Str::f怎么用?PHP Str::f使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Str
的用法示例。
在下文中一共展示了Str::f方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construct
*
* Called when the class is constructed
*
* @access public
* @param mixed
* @return Spark\Grid_Column
*/
public function __construct($identifier = null, array $attributes = array())
{
// Validate the identifier
if (!$identifier) {
throw new Exception(\Str::f('An identifier must be provided when initialising a grid column'));
}
$this->set_identifier($identifier)->set_data($attributes);
}
示例2: get_grid
/**
* Get Grid
*
* Gets the grid this component
* is part of
*
* @access public
* @return Spark\Grid
*/
public final function get_grid()
{
// Make sure the grid has been set for this component
if (!$this->_grid instanceof \Grid) {
throw new \Exception(\Str::f('Cannot retrieve grid instance for %s', get_class($this)));
}
return $this->_grid;
}
示例3: array
* web-based systems easier and quicker.
*
* @package Fuel
* @subpackage Spark
* @version 1.0
* @author Ben Corlett (http://www.bencorlett.com)
* @license MIT License
* @copyright (c) 2011 Ben Corlett
* @link http://spark.bencorlett.com
*/
namespace Spark;
?>
<div class="range">
<div class="line min">
<?php
echo \Form::label('From', \Str::f('grid-%s-filter-%s-min', $filter->get_grid()->get_identifier(), $filter->get_column()->get_identifier()));
?>
<?php
echo \Form::input($filter->get_column()->get_identifier() . '[min]', $filter->get_user_value() ? $filter->get_user_value()->get_min() : null, array('class' => 'filter', 'id' => \Str::f('grid-%s-filter-%s-min', $filter->get_grid()->get_identifier(), $filter->get_column()->get_identifier())));
?>
</div>
<div class="line max">
<?php
echo \Form::label('To', \Str::f('grid-%s-filter-%s-max', $filter->get_grid()->get_identifier(), $filter->get_column()->get_identifier()));
?>
<?php
echo \Form::input($filter->get_column()->get_identifier() . '[max]', $filter->get_user_value() ? $filter->get_user_value()->get_max() : null, array('class' => 'filter', 'id' => \Str::f('grid-%s-filter-%s-max', $filter->get_grid()->get_identifier(), $filter->get_column()->get_identifier())));
?>
</div>
</div><?php
示例4: get_column
/**
* Get Column
*
* Gets the column
* property that this
* cell belongs to
*
* @access public
* @return Spark\Grid_Column_Filter
*/
public function get_column()
{
if (!$this->_column instanceof \Grid_Column) {
throw new \Exception(\Str::f('Cannot retrieve grid column instance for %s', get_class($this)));
}
return $this->_column;
}
示例5: get_driver
/**
* Get Driver
*
* Gets the driver for the
* grid, based off the query
*
* @access public
* @return Spark\Grid_Driver_Abstract
*/
public function get_driver()
{
// Lazy load the driver
if (!$this->_driver) {
// Loop through drivers and determine the driver based off
// the class the query has
foreach ($this->get_drivers() as $query_class => $driver_class) {
// We can either deal with a class or a subclass
if (get_class($this->get_query()) === $query_class or is_subclass_of(get_class($this->get_query()), $query_class)) {
$this->_driver = $driver_class::factory()->set_grid($this);
// Make sure the driver is valid
if (!$this->_driver instanceof \Grid_Driver_Abstract) {
throw new Exception('Grid drivers must extend Spark\\Grid_Driver_Abstract');
}
break;
}
}
// If we still haven't found a driver
// throw an exception
if (!$this->_driver) {
throw new Exception(Str::f('There is no driver for the a query which is an instance of %s', get_class($this->get_query())));
}
}
return $this->_driver;
}
示例6: get_row
/**
* Get Row
*
* Gets the row property
* this cell belongs to
*
* @access public
* @return Spark\Grid_Row Row
*/
public function get_row()
{
if (!$this->_row instanceof \Grid_Row) {
throw new \Exception(\Str::f('Cannot retrieve row instance for %s', get_class($this)));
}
return $this->_row;
}
示例7: __callStatic
/**
* Call Static
*
* Magic method used to create
* an instance of the object
*
* @access public
* @param string Method
* @param array Arguments
* @return mixed
*/
public static function __callStatic($method, array $arguments)
{
if (substr($method, 0, 11) === 'create_from') {
switch (substr($method, 12)) {
case 'post':
return static::factory($_POST)->make_recursive();
case 'get':
return static::factory($_GET)->make_recursive();
}
}
throw new Exception(\Str::f('Call to undefined method %s::%s()', __CLASS__, $method));
}