__construct() public method

Constructor.
public __construct ( array $config = [] ) : void
$config array Configuration options.
return void
Beispiel #1
0
 public function __construct(array $config = array())
 {
     $self =& $this;
     $defaults = array('base' => array(), 'text' => array(), 'textarea' => array(), 'select' => array('multiple' => false), 'attributes' => array('id' => function ($method, $name, $options) use(&$self) {
         if (in_array($method, array('create', 'end', 'label', 'error'))) {
             return;
         }
         if (!$name || $method == 'hidden' && $name == '_method') {
             return;
         }
         return 'foo';
         // $info = $self->binding($name);
         // $model = $info->class;
         // $id = Inflector::camelize(Inflector::slug($info->name));
         // return $model ? basename(str_replace('\\', '/', $model)) . $id : $id;
     }, 'name' => function ($method, $name, $options) {
         if (!strpos($name, '.')) {
             return $name;
         }
         $name = explode('.', $name);
         $first = array_shift($name);
         return $first . '[' . join('][', $name) . ']';
     }));
     parent::__construct(Set::merge($defaults, $config));
 }
Beispiel #2
0
 /**
  * Sets up defaults and passes to parent to setup class.
  *
  * @param  array $config Configuration options.
  * @return void
  */
 public function __construct(array $config = array())
 {
     parent::__construct($config);
     if (extension_loaded('xdebug')) {
         // Register editor using xdebug's file_link_format option.
         $this->editors['xdebug'] = function ($file, $line) {
             return str_replace(array('%f', '%l'), array($file, $line), ini_get('xdebug.file_link_format'));
         };
     }
 }
Beispiel #3
0
 /**
  * Constructor. Configures the helper with the default settings for interacting with
  * security tokens.
  *
  * @param array $config
  * @return void
  */
 public function __construct(array $config = array())
 {
     $defaults = array('sessionKey' => 'security.token', 'salt' => null);
     parent::__construct($config + $defaults);
 }
Beispiel #4
0
 public function __construct($config = array())
 {
     $defaults = array('base' => array(), 'text' => array(), 'textarea' => array(), 'select' => array('multiple' => false));
     parent::__construct((array) $config + $defaults);
 }
 /**
  * Creates a new instance of the Pagination class.
  *
  * Options can be configured by passing them through the $config array.
  *
  * @see app\extensions\helper\Pagination::_init()
  * @param array $config An array of options that can be configured during construction.
  *     They allow for the easy alteration of text used on prev/next links.
  *     Valid options are:
  *
  * @return object An instance of the Pagination class being constructed.
  */
 public function __construct(array $config = [])
 {
     parent::__construct(Set::merge(static::$_defaults, $config));
 }
Beispiel #6
0
 public function __construct(array $config = array())
 {
     $self =& $this;
     $defaults = array('base' => array(), 'text' => array(), 'textarea' => array(), 'select' => array('multiple' => false), 'attributes' => array('id' => function ($method, $name, $options) use(&$self) {
         if (in_array($method, array('create', 'end', 'label', 'error'))) {
             return;
         }
         if (!$name || $method == 'hidden' && $name == '_method') {
             return;
         }
         $id = Inflector::camelize(Inflector::slug($name));
         $model = ($binding = $self->binding()) ? $binding->model() : null;
         return $model ? basename(str_replace('\\', '/', $model)) . $id : $id;
     }));
     parent::__construct(Set::merge($defaults, $config));
 }
 /**
  * Creates a new instance of the Paginator class.
  *
  * Options can be configured by passing them through the $config array.
  *
  * @see li3_paginate\extensions\helper\Paginator::_init()
  * @param array $config An array of options that can be configured during construction.
  *     They allow for the easy alteration of text used on prev/next links,
  *     and adjustment of the separator string. Valid options are:
  *        - `'showFirstLast'`: Include/Exclude "<< First" and "Last >>" links when calling the paginate() method.
  *        - `'showPrevNext'`: Include/Exclude "< Prev" and "Next >" links when calling the paginate() method.
  *        - `'showNumbers'`: Include/Exclude "1 | 2 | 3" numeric links when calling the paginate() method.
  *        - `'firstText'`: Overrides markup used for "<< First" anchor tag.
  *        - `'prevText'`: Overrides markup used for "< Prev" anchor tag.
  *        - `'nextText'`: Overrides markup used for "Next >" anchor tag.
  *        - `'lastText'`: Overrides markup used for "Last >>" anchor tag.
  *        - `'firstTextDisabled'`: Overrides markup used for "<< First" anchor tag when on first page.
  *        - `'prevTextDisabled'`: Overrides markup used for "< Prev" anchor tag when on first page.
  *        - `'nextTextDisabled'`: Overrides markup used for "Next >" anchor tag when on last page.
  *        - `'lastTextDisabled'`: Overrides markup used for "Last >>" anchor tag when on last page.
  *        - `'activePageStyle'`: Sets the style to be used on the active numeric page link.
  *        - `'activePageClass'`: Sets the class to be used on the active numeric page link.
  * @return object An instance of the Paginator class being constructed.
  */
 public function __construct(array $config = array())
 {
     $defaults = array('showFirstLast' => true, 'showPrevNext' => true, 'showNumbers' => true, 'firstText' => "<< First", 'firstTextDisabled' => "", 'prevText' => "< Prev", 'prevTextDisabled' => "", 'nextText' => "Next >", 'nextTextDisabled' => "", 'lastText' => "Last >>", 'lastTextDisabled' => "", 'activeOpenTag' => '<li class="active">', 'openTag' => "<li>", 'closeTag' => "</li>", 'library' => null, 'controller' => "", 'action' => "", 'maxNumbers' => 10);
     parent::__construct($config + $defaults);
 }
 /**
  * Creates a new instance of the Paginator class.
  *
  * Options can be configured by passing them through the $config array.
  *
  * @see li3_paginate\extensions\helper\Paginator::_init()
  * @param array $config An array of options that can be configured during construction.
  *     They allow for the easy alteration of text used on prev/next links,
  *     and adjustment of the separator string. Valid options are:
  *        - `'showFirstLast'`: Include/Exclude "<< First" and "Last >>" links when calling the paginate() method.
  *        - `'showPrevNext'`: Include/Exclude "< Prev" and "Next >" links when calling the paginate() method.
  *        - `'showNumbers'`: Include/Exclude "1 | 2 | 3" numeric links when calling the paginate() method.
  *        - `'firstText'`: Overrides markup used for "<< First" anchor tag.
  *        - `'prevText'`: Overrides markup used for "< Prev" anchor tag.
  *        - `'nextText'`: Overrides markup used for "Next >" anchor tag.
  *        - `'lastText'`: Overrides markup used for "Last >>" anchor tag.
  *        - `'firstTextDisabled'`: Overrides markup used for "<< First" anchor tag when on first page.
  *        - `'prevTextDisabled'`: Overrides markup used for "< Prev" anchor tag when on first page.
  *        - `'nextTextDisabled'`: Overrides markup used for "Next >" anchor tag when on last page.
  *        - `'lastTextDisabled'`: Overrides markup used for "Last >>" anchor tag when on last page.
  *        - `'activePageStyle'`: Sets the style to be used on the active numeric page link.
  *        - `'activePageClass'`: Sets the class to be used on the active numeric page link.
  * @return object An instance of the Paginator class being constructed.
  */
 public function __construct(array $config = array())
 {
     $defaults = array('showFirstLast' => true, 'showPrevNext' => true, 'showNumbers' => true, 'firstText' => "<< First", 'firstTextDisabled' => "", 'prevText' => "< Prev", 'prevTextDisabled' => "", 'nextText' => "Next >", 'nextTextDisabled' => "", 'lastText' => "Last >>", 'lastTextDisabled' => "", 'activeOpenTag' => '<li class="active">', 'openTag' => "<li>", 'closeTag' => "</li>", 'library' => null, 'controller' => "", 'action' => "", 'pagingWrapper' => '<div class="pagination pagination-condensed"><ul>{:content}</ul></div>');
     parent::__construct($config + $defaults);
 }
Beispiel #9
0
 /**
  * Creates a new instance of the Paginator class.
  *
  * Options can be configured by passing them through the $config array.
  *
  * @see li3_paginate\extensions\helper\Paginator::_init()
  * @param array $config An array of options that can be configured during construction.
  *	   They allow for the easy alteration of text used on prev/next links,
  *	   and adjustment of the separator string. Valid options are:
  *		  - `'showFirstLast'`: Include/Exclude "<< First" and "Last >>" links when calling the paginate() method.
  *		  - `'showPrevNext'`: Include/Exclude "< Prev" and "Next >" links when calling the paginate() method.
  *		  - `'showNumbers'`: Include/Exclude "1 | 2 | 3" numeric links when calling the paginate() method.
  *		  - `'firstText'`: Overrides markup used for "<< First" anchor tag.
  *		  - `'prevText'`: Overrides markup used for "< Prev" anchor tag.
  *		  - `'nextText'`: Overrides markup used for "Next >" anchor tag.
  *		  - `'lastText'`: Overrides markup used for "Last >>" anchor tag.
  *		  - `'firstTextDisabled'`: Overrides markup used for "<< First" anchor tag when on first page.
  *		  - `'prevTextDisabled'`: Overrides markup used for "< Prev" anchor tag when on first page.
  *		  - `'nextTextDisabled'`: Overrides markup used for "Next >" anchor tag when on last page.
  *		  - `'lastTextDisabled'`: Overrides markup used for "Last >>" anchor tag when on last page.
  *		  - `'separator'`: Overrides separator used between "< Prev" and "Next >" and numeric page links.
  *		  - `'separatorFirstLast'`: Overrides separator used between "<< First" and "< Prev" as well as between "Next >" and "Last >>".
  *		  - `'activePageStyle'`: Sets the style to be used on the active numeric page link.
  *		  - `'activePageClass'`: Sets the class to be used on the active numeric page link.
  * @return object An instance of the Paginator class being constructed.
  */
 public function __construct(array $config = array())
 {
     $defaults = array('showFirstLast' => true, 'showPrevNext' => true, 'showNumbers' => true, 'firstText' => "<< First", 'firstTextDisabled' => "<< First", 'prevText' => "< Prev", 'prevTextDisabled' => "< Prev", 'nextText' => "Next >", 'nextTextDisabled' => "Next >", 'lastText' => "Last >>", 'lastTextDisabled' => "Last >>", 'separator' => " | ", 'separatorFirstLast' => " ", 'activePageStyle' => "font-weight:bold;", 'activePageClass' => "active", 'openTag' => "", 'closeTag' => "", 'controller' => "", 'action' => "", 'numbersRange' => 3);
     parent::__construct($config + $defaults);
 }
Beispiel #10
0
	public function __construct(array $config = array()) {
		parent::__construct($config);
		$this->_config($config);
	}
Beispiel #11
0
 /**
  * Creates a new instance of the Paginator class.
  *
  * Options can be configured by passing them through the $config array.
  *
  * @see li3_paginate\extensions\helper\Paginator::_init()
  * @param array $config An array of options that can be configured during construction.
  *     They allow for the easy alteration of text used on prev/next links,
  *     and adjustment of the separator string. Valid options are:
  *        - `'showFirstLast'`: Include/Exclude '<< First' and 'Last >>' links when calling the paginate() method.
  *        - `'showPrevNext'`: Include/Exclude '< Prev' and 'Next >' links when calling the paginate() method.
  *        - `'showNumbers'`: Include/Exclude '1 | 2 | 3' numeric links when calling the paginate() method.
  *        - `'firstText'`: Overrides markup used for '<< First' anchor tag.
  *        - `'prevText'`: Overrides markup used for '< Prev' anchor tag.
  *        - `'nextText'`: Overrides markup used for 'Next >' anchor tag.
  *        - `'lastText'`: Overrides markup used for 'Last >>' anchor tag.
  *        - `'firstTextDisabled'`: Overrides markup used for '<< First' anchor tag when on first page.
  *        - `'prevTextDisabled'`: Overrides markup used for '< Prev' anchor tag when on first page.
  *        - `'nextTextDisabled'`: Overrides markup used for 'Next >' anchor tag when on last page.
  *        - `'lastTextDisabled'`: Overrides markup used for 'Last >>' anchor tag when on last page.
  *        - `'separator'`: Overrides separator used between '< Prev' and 'Next >' and numeric page links.
  *        - `'separatorFirstLast'`: Overrides separator used between '<< First' and '< Prev' as well as between 'Next >' and 'Last >>'.
  *        - `'activePageClass'`: Sets the class to be used on the active numeric page link.
  * @return object An instance of the Paginator class being constructed.
  */
 public function __construct(array $config = array()) {
     $defaults = array(
          'showOnEmpty' => false,
          'showFirstLast' => true,
          'showPrevNext' => true,
          'showNumbers' => true,
          'firstText' => '&lt;&lt; First',
          'firstTextDisabled' => '&lt;&lt; First',
          'prevText' => '&lt; Prev',
          'prevTextDisabled' => '&lt; Prev',
          'nextText' => 'Next &gt;',
          'nextTextDisabled' => 'Next &gt;',
          'lastText' => 'Last &gt;&gt;',
          'lastTextDisabled' => 'Last &gt;&gt;',
          'separator' => ' | ',
          'separatorFirstLast' => '&nbsp;',
          'activePageClass' => 'active',
          'linkOptions' => array('escape' => false)
     );
     parent::__construct($config + $defaults);
 }