Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7818565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:37:04+00:00 2026-06-02T06:37:04+00:00

I’m attempting to extend Lithium PHP with smarty, everything is working except my smarty

  • 0

I’m attempting to extend Lithium PHP with smarty, everything is working except my smarty plugin to allow access to lithium helpers.

My smarty function is meant to be a “catchall” for lithium helpers. The part I’m struggling with is dynamically adding the helpers parameters to my callback.

Simplified Code

$params = array('Google', 'http://www.google.com');

$helper = function($args){  
    return $this->html->link($args);
};

return call_user_func_array($helper, $params);

This results with <a href="/Google">Google</a>

Some further testing showed that the above only passed the first item in the $params array to the callback… strange. So I wrapped it in its own array. Take that, thing I cant explain!

return call_user_func_array($helper, array($params));

This produces a lithium error which I wont get into, however it appears that the helper is being passed an array, not translated arguments from the array as individual parameters.

Error snippet
‘No parameter match found for URL ( 0 => 'Google', 1 => 'http://www.google.com', 'controller' => 'pages', 'action' => 'index').

So I gather that I’m missusing the call_user_func_array method.

I’m not sold on this being the only solution to achieve my end, if you can think of a better way to dynamically pass a function any number of arguments at any time I would be greatful.

Please note: $this->html->link is a simplified method to explain my issue, the html and link parts of that object will actually dynamically changed, hence the requirement for completely dynamic function arguments.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:37:05+00:00Added an answer on June 2, 2026 at 6:37 am

    $helper is declared with only one argument and only one is transfered to $this->html->link.

    Why not use call_user_func_array(array($this->html, 'link'), array($params)); directly?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.