public function index19Action() { echo "<h3 style='color:red;font-weight:bold'>" . __METHOD__ . "</h3>"; $input = "Khóa học lập trình Zend Framework cung cấp kiến thức căn bản và chuyên sâu về Zend Framework"; $options = array("patern" => "Zend Framework", "replacement" => "www.zend.vn"); $filter = new \ZendVN\Filter\AddLink($options); $output = $filter->filter($input); echo "<h2>Input: {$input}</h2><br>"; echo "<h2>Output : {$output}</h2>"; return false; }
/** Tìm từ khóa và thêm đường link vào từ khóa đó */ public function index30Action() { $input = 'Khóa học Zend abc Zend ansda Zend Zend'; $options = array('word' => 'Zend', 'link' => 'http://www.zend.vn'); $filter = new \ZendVN\Filter\AddLink($options); $output = $filter->filter($input); echo "<h3>" . $input . "</h3>"; echo "<h3>" . $output . "</h3>"; return false; }