View Single Post
  #2  
Old 11-19-2015, 01:46 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Truncating text with an Output Filter

First of all it is extremely cool that you created your own modifier!

I don't know of any examples where a modifier is passed a value. I'm sure it could be done, but you might have to modify:
Code:
/** * Call for Flexy modifier from AView class * * @param string $callMethod Name of method to call * @param string $expr Exression to modify * * @return string */ protected function flexyModifierCall($callMethod, $expr) { $callMethod = 'flexyModifier' . ucfirst($callMethod); return method_exists($this, $callMethod) ? $this->$callMethod($expr) : ''; }

Reading through the method above, I think it would have to have another argument added, like:
protected function flexyModifierCall($callMethod, $expr, $params = NULL)

Then you could pass it some parameters and use those in your call. But I am just not sure that it is wired that way. Probably I would just create a method that shortened the text with 2 arguments, value and length.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote